Hi Steve
Untested, but try this:
<!--set bg color of all slides in show -->
<$list filter="[tag<slidetag>!sort<slidenum>]">
<$vars slidenum={{!!slidenum}}>
<$wikify name="rgb" text=<<bgcolor>>>
<$action-setfield background-color=<<rgb>>/>
</$wikify>
</$vars>
</$list>
Given that you’ve got a transclusion in the variable ‘bgcolor’, the wikify
widget is simply rendering that transclusion, ie converting it into the
underlying value.
Best wishes
Jeremy.
> On 12 Jan 2018, at 17:48, stevesuny <[email protected]> wrote:
>
> Hi Folks,
>
> I'm creating a simple slideshow macro, and trying to set the background color
> of tiddlers dynamically from the color palette.
>
> I've added this to ViewTemplate (actually, I copied the
> $:/core/ui/ViewTemplate from https://tiddlywiki.com/talkytalky/
> <https://tiddlywiki.com/talkytalky/>) which allows me to set background color
> according to the background-color field.
>
>
> \define frame-styles()
> background-color: $(backgroundColour)$;
> border-color: $(backgroundColour)$;
> \end
>
>
> In my current color palette tiddler ($:/palettes/DWS) I've added these lines:
>
> 1: #DEFF65
> 2: #FF9563
> 3: #FF7575
> 4: #5AD3FF
> 5: #A7FF7B
>
> In each of my tiddlers to be colored, I have a field slidenum set to 1..5.
>
> In my macro I've got this define:
>
> \define bgcolor() {{$:/palettes/DWS##$(slidenum)$}}
>
> And I am using these commands to try to set the background color for each
> tiddler:
>
> <!--set bg color of all slides in show -->
> <$list filter="[tag<slidetag>!sort<slidenum>]">
> <$vars slidenum={{!!slidenum}}>
> <$action-setfield background-color=<<bgcolor>>/>
> </$vars>
> </$list>
>
> It almost works, but in my background-color field, instead of the value from
> the palettte tiddler, I get:
>
> {{$:/palettes/DWS##1}}
>
> Some sort of escaping, I'm sure. Any help much appreciated!
>
> //steve.
>
>
> --
> 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]
> <mailto:[email protected]>.
> To post to this group, send email to [email protected]
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/tiddlywiki
> <https://groups.google.com/group/tiddlywiki>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/850c9dbb-8920-4121-a459-2702380b7fa7%40googlegroups.com
>
> <https://groups.google.com/d/msgid/tiddlywiki/850c9dbb-8920-4121-a459-2702380b7fa7%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
--
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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/B26BEFE2-A764-4C1D-9B74-46057FFEC124%40gmail.com.
For more options, visit https://groups.google.com/d/optout.