I have an arbitrary field on several tiddlers, called bgimage. It 
references a background image.

In ViewTemplate, I have defined a macro (immediately after where 
frame-classes is defined):

    \define bgstyle()
    background-image:url(<$transclude field='bgimage'/>);
    \end

If I call <<bgstyle>> (again, in ViewTemplate) as content of my tiddler, it 
works like I'd expect. It pulls the value from the bgimage field and writes 
it in.

But, if I call it within the <div> tag, like so:

    <div class=<<frame-classes>> style=<<bgstyle>>>

...it comes through unrendered, as a literal (the raw string, 
"background-image:url(<$transclude field='bgimage'/>);" instead.

Why does the macro get expanded in the content but not within the div 
element? 
I get the sense that if I understood that, I'd understand TiddlyWiki a lot 
better.

Can anyone explain this behaviour and suggest how this ought to be done? 
Thanks!

 - John Maxwell

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to