Using layouts - partial page templates
Hi there. I'm looking to create a Layout.tml template file to hold the header/footer/navigation elements of my page, and then create the content within separate files such as Index.tml, About.tml Obviously, at the moment, when viewing these files outside of Tapestry, they just show a snippet of html. It is only when running under tapestry that it fills in the surrounding header/body at runtime using the Layout.tml template and replacing the t:body/ element. So far so good. But I would like Index.tml and About.tml to look complete when viewed as plain files (not running under tapestry), to help our designer. Therefore I would like Index.tml and About.tml to have all the complete header/body elements. I tried putting t:remove tags around the html in these files that I want tapestry to ignore at runtime (so it can replace them with the contents of Layout.tml. But this doesnt seem to work. Is there another way to achieve what Im trying to do? Many thanks, David. Is ther -- View this message in context: http://tapestry.1045711.n5.nabble.com/Using-layouts-partial-page-templates-tp4806800p4806800.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Using layouts - partial page templates
Can you elaborate on the t:remove tags not working and a T5 version? I've not had any trouble with it in the past. Steve. Ther is On 15 September 2011 21:16, dkeenan david_siedle...@yahoo.co.uk wrote: Hi there. I'm looking to create a Layout.tml template file to hold the header/footer/navigation elements of my page, and then create the content within separate files such as Index.tml, About.tml Obviously, at the moment, when viewing these files outside of Tapestry, they just show a snippet of html. It is only when running under tapestry that it fills in the surrounding header/body at runtime using the Layout.tml template and replacing the t:body/ element. So far so good. But I would like Index.tml and About.tml to look complete when viewed as plain files (not running under tapestry), to help our designer. Therefore I would like Index.tml and About.tml to have all the complete header/body elements. I tried putting t:remove tags around the html in these files that I want tapestry to ignore at runtime (so it can replace them with the contents of Layout.tml. But this doesnt seem to work. Is there another way to achieve what Im trying to do? Many thanks, David. Is ther - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Using layouts - partial page templates
Hi. the trouble is when I try to escape everything around the main content.. eg. if the About.tml looks a bit like this... html head /head body about text /body html I want it to have all the body/head tags in the TML file as above, so it can easily be viewed outiside of tapestry. But, i want tapestry to use Layout.tml to fill in everyting outside of the content, when running live. So i tried doing this approach... t:remove html head /head body /t:remove about text t:remove /body html /t:remove I was hoping that tapestry would remove the surrounding html at runtime, and fill this in using the HTML for my Layout.tml template. But tapestry doesnt like removing the above sections as the elements inside the remove tags dont have matching open close elements. I know this seems like a really long winded way of doing what I want but I cant find anyting simpler. Essentiall i jsut want to have a bunch of TML files that can easily be viewed in a browser (nice for the designer), but then Tapestry strips out the nav bar at the top and the footer etc. and replaces them with ones from Layout.tml. I wanted to do this so I know that all pages have the correct up to date nav bar/footer when running live, but the designer can still design against full html pages? Thanks again, David. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Using-layouts-partial-page-templates-tp4806800p4806846.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Using layouts - partial page templates
David - try using the t:content element ( http://tapestry.apache.org/component-templates.html). It's supposed to do exactly what you need - just put it around your main content and everything else would be ignored when the template is rendered. Cheers, Alex K On Thu, Sep 15, 2011 at 9:32 AM, dkeenan david_siedle...@yahoo.co.ukwrote: Hi. the trouble is when I try to escape everything around the main content.. eg. if the About.tml looks a bit like this... html head /head body about text /body html I want it to have all the body/head tags in the TML file as above, so it can easily be viewed outiside of tapestry. But, i want tapestry to use Layout.tml to fill in everyting outside of the content, when running live. So i tried doing this approach... t:remove html head /head body /t:remove about text t:remove /body html /t:remove I was hoping that tapestry would remove the surrounding html at runtime, and fill this in using the HTML for my Layout.tml template. But tapestry doesnt like removing the above sections as the elements inside the remove tags dont have matching open close elements. I know this seems like a really long winded way of doing what I want but I cant find anyting simpler. Essentiall i jsut want to have a bunch of TML files that can easily be viewed in a browser (nice for the designer), but then Tapestry strips out the nav bar at the top and the footer etc. and replaces them with ones from Layout.tml. I wanted to do this so I know that all pages have the correct up to date nav bar/footer when running live, but the designer can still design against full html pages? Thanks again, David. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Using-layouts-partial-page-templates-tp4806800p4806846.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Using layouts - partial page templates
Thank you s much!. That's exactly what I've been looking for. Should have read more closely. Cheers, David. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Using-layouts-partial-page-templates-tp4806800p4806882.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org