Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
atomi opened this Issue · 5 comments

4 participants

atomi Scott Murphy Christopher Hotchkiss Vladimir Orany
atomi

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

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

Scott Murphy
Owner

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.

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

Christopher Hotchkiss

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

atomi

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.

Scott Murphy
Owner

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

<body>
<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;
    }
</script>
Vladimir Orany musketyr referenced this issue from a commit
Vladimir Orany musketyr test for #23 26f1f42
Vladimir Orany

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

Scott Murphy codeconsole closed this in #49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.