Sitemesh3 custom properties

940 views
Skip to first unread message

Bryn Cooke

unread,
Feb 18, 2013, 4:59:05 AM2/18/13
to sitemes...@googlegroups.com
Hi
I'm taking a look at sitemesh3 as it is one of the few templating frameworks that can deal with non XML markup which is ideal for html5.

In the sitemesh3 documentation it says:
"The <sitemesh:write property='...'/> tag will be rewritten by SiteMesh to include properties extracted from the content. There are more properties that can be extracted from the content and it's possible to define your own rules - that will be covered in another tutorial."

I'm not sure the other tutorial exists yet, can anyone give me a pointer as to how to extract properties other than body, head and title? Perhaps I can write it up for the wiki.

Thanks in advance,
Bryn




Bryn Cooke

unread,
Feb 18, 2013, 1:51:39 PM2/18/13
to sitemes...@googlegroups.com
OK, I figured this out.

I can add the DivExtractingTagRuleBundle when building the filter:

builder.addTagRuleBundle(new DivExtractingTagRuleBundle());

After which any div with an id becomes a property that can be replaced e.g.
if I have a 

<div id="content">
Something
</div>

Then this will write it out:
<sitemesh:write property='div.content' />

Tin Pham

unread,
Feb 26, 2013, 10:32:17 PM2/26/13
to sitemes...@googlegroups.com
Thanks for sharing your solution Byrn!


--
 
---
You received this message because you are subscribed to the Google Groups "SiteMesh 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sitemesh3-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages