Hi Mike,

There are a few syntactic mistakes in your code (@action-sendmessage
instead of $action-sendmessage, and calling style-actions while you defined
style_actions). Also, the actions attribute in $select should be a text, so
you should write actions="<<style_actions>>".

But the main flaw seems to be that you assume in style_actions that the
currentTiddler will take the value of the selected option, which is not the
case: selected options are only saved in the tiddler field that you set in
the "tiddler" attribute.

Cheers,
Xavier.
P.S. Regarding your dynamic stylesheet problem, what about applying custom
styles by tag?
https://tiddlywiki.com/#How%20to%20apply%20custom%20styles%20by%20tag

-- Xavier Cazin

On Sat, Mar 10, 2018 at 10:10 PM, Michael Wiktowy <mwikt...@gmail.com>
wrote:

> Hi,
>
> I either have a fundamental misunderstanding about tm-* action type action
> messages, fieldmangler or triggering actions with a select widget and I'm
> hoping that someone can set me straight or point me to an example of their
> use together because the example in the default TiddlyWiki is not
> illuminating on tm-* actions and "event.param"s. My code snippet:
>
> \define indirect_transclude() <$transclude tiddler='$:/temp/print_proof'
> field='template_style'/>
>
> \define style_actions()
>
> <$list filter='[tag[mystyle]]'>
> <$fieldmangler>
> <@action-sendmessage $message='tm-remove-tag' param='$:/tags/Stylesheet'/>
> </$fieldmangler>
> </$list>
>
> <$wikify name="indirect" text=<<indirect_transclude>>>
> <$fieldmangler tiddler=<<indirect>>>
> <@action-sendmessage $message='tm-add-tag' param='$:/tags/Stylesheet'/>
> </$fieldmangler></$wikify>
>
> \end
>
> <$select tiddler='$:/temp/print_proof' actions=<<style-actions>>>
> <$list filter='[tag[template]]'>
> <option value=<<currentTiddler>>><$view field='title'/></option>
> </$list>
> </$select>
>
> I am trying to make a mailing label sheet generator.
>
> I am using the selectwidget to pick between various templates and have
> their tiddler title put into '$:/temp/print_proof' for a subsequent print
> proof page to display them. That seems to work fine.
>
> Struggle as I have to have multiple different active @media print {} CSS
> rules running for different templates, it seems that you cannot. So I
> wanted the SelectWidget to also remove all the '$:/tags/Stylesheet' tags
> from 'mystyle' tagged tiddlers that will be paired with the templates (by
> putting their title in the template's template_style field) and just adding
> that tag to the one template that is selected. That way future templates
> could be easily added for different sheet layouts and be paired either with
> existing @media print stylesheets that work or a new one.
>
> However, even the first part of the style_actions macro doesn't work to
> strip the Stylesheet tags. The $wikify widget was something that I needed
> to do for the proof sheet display a tiddler that was indirectly referenced
> in the '$:/temp/print_proof' tiddler so I figured that I would need it here
> to indirectly reference the stylesheet title in the template field.
>
> Anyone have an idea where my train of thought has derailed?
>
> /Mike
>
> --
> 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 tiddlywiki+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywiki@googlegroups.com.
> 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/362d9d08-80c4-4917-9a2f-4d146983d13e%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywiki/362d9d08-80c4-4917-9a2f-4d146983d13e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit 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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/CADeSwYOYeUgFsZT%2BMNPrys5Nn6VpP1gs9Fa-jBSTD1w4kXxhdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to