Adrien,
Your example is so complex, I would advise extracting the simplest example
of the problem you face and sharing that. You may even solve your problem
in the process. It is a lot to ask volunteers more than you have to.
Tiddlywiki documents its own mechanisiums well. If you can find it in the
tiddlywiki.com documentation try looking inside tiddletwiki itself. For
example the title is displayed on tiddlers with
$:/core/ui/ViewTemplate/title and this will show the icon if it is
provided. Looking inside this tiddler we see it access the icon as follows
<$set name="foregroundColor" value={{!!color}}>
>>
<$transclude tiddler={{!!icon}}/>
Will this work for your problem?
Otherwise please restate the issue with a minimal case if at all possible.
Regards
Tony
On Friday, August 9, 2019 at 4:42:15 AM UTC+10, Adrien F wrote:
>
> On multiple occasions I need to have buttons display the icon from the
> "icon" field of another tiddler. In this other tiddler the "icon" field is
> the name of a tiddler that is not an image but is using a FontAwesome
> macro. (I also tried on multiple occasions using an svg as the tiddler
> referenced by the icon field, so I don't think that's the problem)
>
> I tried my best for the past week to find a solution to this problem by
> myself with online resources but I can't find this very topic mentioned
> anywhere and the solution keeps eluding me.
>
> For instance this is the content of a modified tabs macro I'm using :
>
> Enter code here...\define viewmode-icon-tabs(tabsList,default,state:
> "$:/state/tab",class,template,buttonTemplate,retain)
>
>
> <$list filter="$tabsList$" variable="currentTab"><$set name=
> "save-currentTiddler" value=<>><$tiddler tiddler=<<
> currentTab>>><$button set=<> setTo=<>
> default="$default$" selectedClass="tc-tab-selected" tooltip={{!!tooltip}}>
> <$tiddler tiddler=<>>
> <$set name="tv-wikilinks" value="no">
>
> <$setvars
> _currentTab=<>
> _currentTabIcon=[[currentTab!!icon]]
> tabIcon="\{{\ currentTabIcon \}}\">
>
> <>
> <$image src=<> />
>
>
> <$transclude tiddler=<> field="role"/>
>
> <$transclude tiddler="$buttonTemplate$" mode="inline">
> <$macrocall $name="tabIconPath" $type="image/svg+xml" $output="image/svg+
> xml"/>
>
>
>
>
>
>
>
> <$list filter="$tabsList$" variable="currentTab">
>
> <$reveal type="match" state=<> text=<>
> default="$default$" retain="""$retain$""">
>
> <$transclude tiddler="$template$" mode="block">
>
> <$transclude tiddler=<> mode="block"/>
>
>
>
>
>
>
>
>
> \end
>
>
> And this is the result whatever I try with my variables. Developper tools
> confirm that the image src is undefined.
>
> [image: no-tab-icons.png]
>
> The closest I got to transcluding the icon was with using
>
> <$transclude tiddler=<> field="role"/>
>
> ... wich made the tabs display the name of the tiddler containing the
> FontAwesome macro.
>
> Hints ?
>
--
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/61cfcc3d-4583-419c-9206-548f8cc03dc7%40googlegroups.com.