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;

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

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

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

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16

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.


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

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

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


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

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

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

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


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

   <div id="mainContentDiv" />

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

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

1 follower



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