0

Center template using every page

asked 2015-02-04 08:55:57 +0800

emreturka gravatar image emreturka
9 2

Hi zk users; I have written a main template that includes header,left,center and footer templates.header,left and footer templates are same every page.But center template can be changeable every page.Now I have include template zul file above;

<zk>
    <include src="/templates/mainTemplate.zul"> 
     </include>
</zk>

So how to mange center template zul file (putting components for using) ? (Note : centerTemplate.zul file is empty.I fill this page on every page different.)

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-02-04 10:02:48 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2015-02-04 10:04:53 +0800

There are several ways to do that. It's not clear what you want.

(1) you can wrap all your stuff, header, footer and content in a dependent page. So all times all is new rendered.

wrap_content1.zul

<zk>
  <include src="/templates/header.zul"/> 

   <include src="/templates/content1.zul"/> 

  <include src="/templates/footer.zul"/> 
</zk>

wrap_content2.zul

<zk>
  <include src="/templates/header.zul"/> 

   <include src="/templates/content2.zul"/> 

  <include src="/templates/footer.zul"/> 
</zk>

(2) you can change only the content by appending your dependent zul page in the div.

main.zul

<zk>
  <include src="/templates/header.zul"/> 

   <div id="mainContentDiv" />

  <include src="/templates/footer.zul"/> 
</zk>

onClickMenuItem:
mainContentDiv.getChildren().clear();
Executions.createComponents("/templates/myContent1.zul", mainContentDiv ,null);

hope this helps

best Stephan

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2015-02-04 08:55:57 +0800

Seen: 13 times

Last updated: Feb 04 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More