Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

<sitemesh:write property=""> not being parsed inside element attributes #23

atomi opened this Issue Jan 17, 2011 · 5 comments


None yet
4 participants

atomi commented Jan 17, 2011

<body id='<sitemesh:write property="body.id" />'>
<input id='meta.page' type='hidden' value='<sitemesh:write property="meta.page">' />
<body id="<sitemesh:write property='body.id' />">

I'm unable to get these to work in sitemesh3 using a .gtpl or .html decorator.


codeconsole commented Apr 2, 2011

Example 2 works for me. I will work on 1 and 3, but for now, use javascript after the body tag inside the decorator to set the id and class on the body using Example 2.

document.body.id = document.getElementById('meta.page');

I don't any code with the examples, is this still an issue?

atomi commented Oct 11, 2011

I would guess so. There haven't been any updates since this was reported.

Edit: It looks like github decided not to parse the code examples as markdown anymore.
I went ahead and encoded the html chars.


codeconsole commented Oct 15, 2011

Here is my code (It has been working flawlessly for almost a year now...):

<input id="meta.body.id" type="hidden" value="<sitemesh:write property="body.id" />"/>
<input id="meta.body.class" type="hidden" value="<sitemesh:write property="body.class" />"/>
<script type="text/javascript">
    var bodyClass = document.getElementById('meta.body.class').value;
    var bodyId = document.getElementById('meta.body.id').value;
    if (bodyId) {
        document.body.id = bodyid;
    if (bodyClass) {
        document.body.className = bodyClass;

musketyr commented Aug 14, 2013

fyi example 2 works well if you close the tag properly. <sitemesh:write property="body.id"/>

@codeconsole codeconsole closed this in #49 Aug 14, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment