Joe,

They say option A is Preferred and Option B deprecated, which may suit you, 
but perhaps only if you simplify the content of {{tiddler}}

However I think you you can write

\define macroname()
<$action..
<$action..
<$action..
\end


<$button actions=<<macroname>> > Text </$button>



So  in your example yes "{{Tiddler}} must mean "the string formed from the 
contents of Tiddler"

I have even made macros containing the field=value pairs 

eg
\define new-tiddler-fields()
fieldname1=value
fieldname2=value
...
\end

Regards
Tony

On Thursday, January 10, 2019 at 8:32:16 PM UTC+11, Joe Armstrong wrote:
>
>
>
> On Wednesday, 9 January 2019 22:07:09 UTC+1, TonyM wrote:
>>
>> Joe,
>>
>> Some mussings that may help your learning path.
>>
>> Just to keep it clear {{Tiddler}}
>> Means transclude Tiddler, by default the text field. You could transclude 
>> the content of fieldname as well eg {{Tiddler!!fieldname}}
>>
>> Whilst calling this transclusion we often refer to as "text reference" 
>> because it references other text "in line". Commonly used for storing a 
>> tiddller containing a state of something, it also allows you include one or 
>> a set of predifined actions into the actions parameter, and thus can work 
>> as reusable code/actions.
>>
>> When you transclude something in something else it clearly gets replaced 
>> before the widget or wiki text is interpreted, and usualy itself 
>> interpreted before hand. So if you transcluded a tiddler containing a list 
>> widget in wikitext it would tranlate into a list as wikitext is want to, 
>> but not in a parameter, allowing the widget to act on the parameter.
>>
>> You can also include actions inside 
>> <$button parms>
>> Zero or more Action widgets as in your example
>> Button text or image
>> </$button>
>>
>> But the above model with action widgets inside buttons supposed to be 
>> avoided, which I do not like as it can sometimes make it harder to read 
>> your own code since actions parameter points to somewhere else.
>>
>
> I didn't quite understand the last sentence.
>
> I think you're saying that style A is better than B
>
> where A is
>
>      <$button actions = {{{Tiddler}}} > Text </$button>
>
> and B is
>       
>       <$button>
>            Actions
>       </$button>
>
> To my eye A is better in the sense that less verbose = good
>
> It might be that B is better since you only have to read one tiddler code
> to understand what's going on and if you have no intention of reusing the
> action code it makes sense to put everything in one place.
>
> Is their a recommended best practise?
>
> Cheers
>
> /Joe
>
> Cheers
>
> /Joe
>
>
>     
>
>
>
>  
>
>> Enjoy
>> Tony
>>
>>

-- 
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/932b3d70-4e93-439e-90df-c091182e3426%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to