Hi Tones, thanks for your comment.

>>> but I would expect it is a little problematic because you are making 
use of the short form of the transclude statement 

I'm assuming that by "short form" you mean using curly braces rather than 
the transclude widget? If so how could I use the transclude widget to 
generate multiple templates?

>>> My initial thought is to use a macro instead, even if that macro then 
invokes a "transclusion view template" and then the transcludes the named 
template.
>>> 
>>> <<ingredient tomatoes>>

Yes if this is possible then great, but how could I actually do it? I would 
want to be able to generate a new macro for every tiddler with the tag 
"type". As far as I can tell you can't define macros within a list widget.

>>> <<object ingredient tomatoes>> which could detect if "ingredients" is 
defined, then if "tomatoes" is defined and provide create buttons, but once 
created seek the ingredients and ingredient details and display as you 
macro deems. 

Thanks I did not think of this (having a single macro which takes both 
"type" and "linked tiddler" as parameters). It's not ideal but it's an 
option I could use as a last resort. I'm not sure what you mean by "create 
buttons" though.

>>> An approach is to use a macro with a list widget where ingredients is 
the name of the template the list widget uses.

OK now I'm lost. Can you give an example of what you mean?

>>> Finally remember tiddlers (or fields for that matter) that are 
transcluded can also transclude multiple levels deep. 

Yes but I can't see what the relevance of this is. Could you add a bit more 
detail?
On Monday, 21 June 2021 at 01:11:23 UTC+1 TW Tones wrote:

> Si,
>
> I see what you want to achieve, I think the functionality is possible 
> (perhaps not literally though), and I will give it more thought, but I 
> would expect it is a little problematic because you are making use of the 
> short form of the transclude statement, and you want that to do extra work, 
> such as making use of a template to the transcluded "template", a bit like 
> a view Template for transclusions.
>
> My initial thought is to use a macro instead, even if that macro then 
> invokes a "transclusion view template" and then the transcludes the named 
> template.
>
> <<ingredient tomatoes>>
>
> But if you want to generalise even further
> <<object ingredient tomatoes>> which could detect if "ingredients" is 
> defined, then if "tomatoes" is defined and provide create buttons, but once 
> created seek the ingredients and ingredient details and display as you 
> macro deems.
>
> The thing is macros allow for higher levels of abstraction, the inclusion 
> of code detecting "existence" and offering to create custom tiddlers, not 
> to mention determining the formatting of the display of content. I also add 
> to macros mode or state switches, for example if the wiki has 
> $:/config/author-mode = yes then provide the new buttons if the object 
> "ingredients" or instance "tomato" do not exist, otherwise indicate a 
> missing object/ingredient.
>
> An approach is to use a macro with a list widget where ingredients is the 
> name of the template the list widget uses.
>
> Finally remember tiddlers (or fields for that matter) that are transcluded 
> can also transclude multiple levels deep.
>
> Regards
> Tones
> On Sunday, 20 June 2021 at 20:32:59 UTC+10 Si wrote:
>
>> I thought I'd give this a bump just in case there's anyone out there who 
>> missed it that can help me...
>>
>> On Tuesday, 15 June 2021 at 16:28:36 UTC+1 Si wrote:
>>
>>> I've been experimenting with using "typed" links in my wiki, inspired by 
>>> this 
>>> post 
>>> <https://groups.google.com/g/tiddlywiki/c/C0CqNyKU1Jc/m/5sFLzH7XAQAJ> 
>>> from a few months back.
>>>
>>> For example if I want to link to a food item, but also indicate that it 
>>> is an ingredient, I write:
>>>
>>> {{tomatoes||ingredient}}
>>>
>>> Where I have the following "type" tiddler:
>>>
>>> title: ingredient
>>> tags: type
>>> text: <$link to=<<currentTiddler>><<currentTiddler>></$link>
>>>
>>> I'm wondering if there is anyway to generalise this so that I don't 
>>> actually have to add the template to the text field of every "type" tiddler 
>>> I create? Specifically I want to leave the text field free for other 
>>> content, and also be able to use *any* tiddler with the tag "type" in 
>>> the same way. So all I would have to do is add a tiddler with the title 
>>> "ingredient" and the tag "type" and immediately be able to use it as a link 
>>> template.
>>>
>>> Alternatively maybe there is a way to generate multiple *macros* in a 
>>> similar way? A tiddler with the title "ingredient" and the tag "type" would 
>>> trigger the implicit creation of an "ingredient" macro. 
>>>
>>> I can't see how this would be possible, but I'm wondering if there's a 
>>> trick I'm missing?
>>>
>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/dd64739e-1198-40bd-a315-e587f59175ban%40googlegroups.com.

Reply via email to