iamdar, Here is a link to some documentation that may help you more generally at this phase of your learing, https://anthonymuscio.github.io/#Standard%20Nomenclature
Its an updated version of something published by Tobias in the past. In particular look at the foot notes about values in parameters widget and HTML, it shows why any "concatenation" to make compound values needs to be done, as ewrioc says the best way without making custom macros and wikifying them is to use the filtered transclusions. With these you use a filter inside triple curly braces to generate the value (no need for an intermediate variable) and filters permit variables, transclusions and field content to be concatinated. Also, As someone in the learning phase please do feedback if you need something clarified or added to my document as you have the insight to what is needed during the learning process, unfortunately I now know too much. You can help other that pass this way in the future. Regards Tones On Thursday, 10 June 2021 at 04:37:15 UTC+10 [email protected] wrote: > Thank you so much Eric! Really thank you so much! I'm a little happy to > see I was kind of heading in the right direction at one point earlier, > except I put the \end of the tocscript define below the </$tiddler> because > I was afraid it wouldn't include itself in the button code and it broke it > lol. Also thank you very much for providing the explanations as well! > > The !!storyname was actually left over from the step before this one. I > hadn't considered having a dynamic toc at first. Though now I'll use it in > the tocscript to help identify the page a bit better. Thank you for looking > that closely at the script! > > > > On Wednesday, June 9, 2021 at 2:05:23 PM UTC-4 Eric Shulman wrote: > >> On Wednesday, June 9, 2021 at 9:53:36 AM UTC-7 [email protected] wrote: >> >>> I can't figure out how to: >>> >> 1) Make the toc div text a variable, named tocscript, to call it in the >>> script like the fields, so I can add it to the new tiddler being created. >>> >> >> Move the toc div text into a macro named "tocscript". Macros are >> essentially variables that can accept parameters. >> >> 2) Update the tag name in the toc-selective-expandable macro before it is >>> added to the new tiddler being created. >>> >> >> Within a macro, there are two forms of syntax that are automatically >> replaced when the macro is processed: >> * instances of $paramname$ are replaced by corresponding values that are >> passed to the macro as parameters >> * instances of $(varname)$ are replaced by corresponding values that are >> defined in variables before the macro is invoked >> >> Thus, for your purposes: >> \define temp() $:/temp/input/$(currentTiddler)$ >> >> \define tocscript() >> <div class="tc-table-of-contents"> >> <<toc-selective-expandable "$(storyabbrev)$" "sort[title]">> >> </div> >> \end >> >> | Story Name:|<$edit-text tiddler=<<temp>> field="storyname"/> | >> | Story Abbreviation:|<$edit-text tiddler=<<temp>> >> field="storyabbrev"/> | >> >> <$tiddler tiddler=<<temp>>> >> <$button> Create Story >> <$vars storyabbrev={{!!storyabbrev}}> >> <$action-setfield $tiddler={{!!storyabbrev}} text=<<tocscript>> >> tags="Stories" /> >> <$action-setfield $tiddler={{{ [{!!storyabbrev}addsuffix[ Chapter >> 001]] }}} tags={{!!storyabbrev}} /> >> <$action-deletetiddler tiddler=<<temp>> /> >> </$vars> >> </$button> >> </$tiddler> >> >> Notes: >> * The $vars widget fetches the !!storyabbrev input value to turn it into >> a variable named "storyabbrev", so that it can then be automatically >> replaced in the tocscript macro >> * I don't see anywhere that you actually use the "!!storyname" input value >> >> enjoy, >> -e >> > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/9e962e71-ddc1-4009-94df-854713fcb092n%40googlegroups.com.

