[tw5] Re: Transcluding an image from another tiddler's icon field

2020-02-02 Thread A Gloom

>
>
> <$set name="refTid" value={{test/TiddlerA}}>
>
> <$button>
><$transclude tiddler=<> field="icon"/>
> 
>
> <$set>
>

This doesn't work because of 

value={{test/TiddlerA}}

it feeds the transclude widget the text field contents of test?TiddlerA ( 
{{}} transcludes the tidder's content as the variable value) instead of the 
tiddler's title...


value="test/TiddlerA"

will feed the title to the transclude widget so it can read the icon field 
of it

-- 
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/52021b31-b7a2-4209-89c7-10c0db589965%40googlegroups.com.


[tw5] Re: Transcluding an image from another tiddler's icon field

2019-08-09 Thread Adrien F
Thanks Tony for your response.

Alas I could not get it to work taking example from 
$:/core/ui/ViewTemplate/title.

You're quite right, the problem can be simplified alot. I'm very new to 
using WikiText and thought it could have to do with to the way the tabs 
macro passes currentTiddler and currentTab, but I could reproduce the issue 
just this way :


   1. name one tiddler "test/Icon" that contains an image
   2. create a tiddler "test/tiddlerA" with the icon field set to 
   "test/icon"
   3. create a tiddler "test/tiddlerB" with a button transcluding the image 
   referenced as the icon by "test/tiddlerA" like so :

<$set name="refTid" value={{test/TiddlerA}}>

<$button>
   <$transclude tiddler=<> field="icon"/>


<$set>

This is easier to reproduce and works (or rather doesn't) the same.


-- 
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/812a5497-2203-48d2-9e62-4cf70686f88b%40googlegroups.com.


[tw5] Re: Transcluding an image from another tiddler's icon field

2019-08-08 Thread TonyM
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.