Re: How to set a meta header tag in template?
OK. Let's say your template has a corresponding java class Site.java which is a component. This component has a parameter defined like @Parameter(required=false) @Property private Block httpTags; you can use this block in your Site.tml via To pass a block to the Site component you can either define the site component within the nochachepage.java and pass it there or you define the parameter in the nocachepage.tml: http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";> BTW, that's < 5.1 syntax the new way would look like this (untested) http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"; xmlns:p="tapestry:parameter"> Hope that helps, Markus On Tue, Jul 14, 2009 at 7:57 PM, learningtapestry wrote: > > Markus, > > Thanks for your response. Could you please provide a small example of how > you can pass a block as a parameter into the template? Let's assume the > template is Site.tml and the page is NoCachePage.java/NoCachePage.tml. Let's > also assume I have the String parameter called "httpMetaTags" defined as a > bunch of meta tags inside NoCachePage.java. The missing link for me is how > to get the httpMetaTags into template. > > > Markus Joschko wrote: >> >> In the same way you can also pass a block as a parameter that contains >> arbitrary html (meta tags). The block can be defined in the page and >> then be passed to the layout to render it where needed. >> >> Cheers, >> Markus >> > > -- > View this message in context: > http://www.nabble.com/How-to-set-a-meta-header-tag-in-template--tp24436287p24484662.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 > > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to set a meta header tag in template?
Markus, Thanks for your response. Could you please provide a small example of how you can pass a block as a parameter into the template? Let's assume the template is Site.tml and the page is NoCachePage.java/NoCachePage.tml. Let's also assume I have the String parameter called "httpMetaTags" defined as a bunch of meta tags inside NoCachePage.java. The missing link for me is how to get the httpMetaTags into template. Markus Joschko wrote: > > In the same way you can also pass a block as a parameter that contains > arbitrary html (meta tags). The block can be defined in the page and > then be passed to the layout to render it where needed. > > Cheers, > Markus > -- View this message in context: http://www.nabble.com/How-to-set-a-meta-header-tag-in-template--tp24436287p24484662.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: How to set a meta header tag in template?
In the same way you can also pass a block as a parameter that contains arbitrary html (meta tags). The block can be defined in the page and then be passed to the layout to render it where needed. Cheers, Markus On Sun, Jul 12, 2009 at 1:40 AM, nille hammer wrote: > Hi learning, > > use the if-Component in conjunction with a parameter for your > layout-component that controlls the rendering. Your layout.tml would contain > > > > > > > > > > your Layout.java would contain > @Parameter > @Property(write=false) > private boolean cachingDisabled; > > And in the tml of the page using the layout you would do > > ... > > Regards, nillehammer > == > http://www.winfonet.eu > > - original Nachricht > > Betreff: How to set a meta header tag in template? > Gesendet: Sa, 11. Jul 2009 > Von: learningtapestry > >> >> I am using tapestry version 5.1.0.3. I have a basic SiteLayout defined >> >> http://www.w3.org/1999/xhtml"; >> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";> >> >> ...some css styles... >> >> >> ...some html goes here... >> >> >> >> >> >> Now as someone navigates my site, there is a particular page on which I >> want >> to turn off caching (because it always has to get the latest data from the >> servers on that page). So, lets say I have a page "NoCachePage.java" and >> "NoCachePage.tml" already coded. But the head tag is defined in the >> Site.tml >> template. How can I get my http meta tag > CONTENT="NO-CACHE"/> into the Site.tml's head element? >> >> I tried setting up @CleanUpRender inside NoCachePage.java and tried to >> manipulate the DOM through the MarkupWriter. But it appears as if >> MarkupWriter doesn't provide any method of adding an element under the >> "head" html tag. >> >> How am I supposed to add the no-cache meta http tag into the head element >> from my NoCachePage component? Please help. >> -- >> View this message in context: >> http://www.nabble.com/How-to-set-a-meta-header-tag-in-template--tp24436287p2 >> 4436287.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 >> >> > > --- original Nachricht Ende > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to set a meta header tag in template?
Hi learning, use the if-Component in conjunction with a parameter for your layout-component that controlls the rendering. Your layout.tml would contain your Layout.java would contain @Parameter @Property(write=false) private boolean cachingDisabled; And in the tml of the page using the layout you would do ... Regards, nillehammer == http://www.winfonet.eu - original Nachricht Betreff: How to set a meta header tag in template? Gesendet: Sa, 11. Jul 2009 Von: learningtapestry > > I am using tapestry version 5.1.0.3. I have a basic SiteLayout defined > > http://www.w3.org/1999/xhtml"; > xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";> > > ...some css styles... > > > ...some html goes here... > > > > > > Now as someone navigates my site, there is a particular page on which I > want > to turn off caching (because it always has to get the latest data from the > servers on that page). So, lets say I have a page "NoCachePage.java" and > "NoCachePage.tml" already coded. But the head tag is defined in the > Site.tml > template. How can I get my http meta tag CONTENT="NO-CACHE"/> into the Site.tml's head element? > > I tried setting up @CleanUpRender inside NoCachePage.java and tried to > manipulate the DOM through the MarkupWriter. But it appears as if > MarkupWriter doesn't provide any method of adding an element under the > "head" html tag. > > How am I supposed to add the no-cache meta http tag into the head element > from my NoCachePage component? Please help. > -- > View this message in context: > http://www.nabble.com/How-to-set-a-meta-header-tag-in-template--tp24436287p2 > 4436287.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 > > --- original Nachricht Ende - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
How to set a meta header tag in template?
I am using tapestry version 5.1.0.3. I have a basic SiteLayout defined http://www.w3.org/1999/xhtml"; xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";> ...some css styles... ...some html goes here... Now as someone navigates my site, there is a particular page on which I want to turn off caching (because it always has to get the latest data from the servers on that page). So, lets say I have a page "NoCachePage.java" and "NoCachePage.tml" already coded. But the head tag is defined in the Site.tml template. How can I get my http meta tag into the Site.tml's head element? I tried setting up @CleanUpRender inside NoCachePage.java and tried to manipulate the DOM through the MarkupWriter. But it appears as if MarkupWriter doesn't provide any method of adding an element under the "head" html tag. How am I supposed to add the no-cache meta http tag into the head element from my NoCachePage component? Please help. -- View this message in context: http://www.nabble.com/How-to-set-a-meta-header-tag-in-template--tp24436287p24436287.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