Accidental Discovery

Something that works

Rather than use the icon field I created an additional one
menu-icon If this icon tiddler name is in {{   }}
The macro call icon="{{$menuname$!!menu-icon}}"
And the button $icon$ 

The Problem  is it stops me using the default icon field and Color 
(VALUE #ff8080) from the $menuname$ tiddler.

Tony
 

On Thursday, January 18, 2018 at 7:39:28 PM UTC+11, TonyM wrote:
>
> Mark,
>
> Thanks for the Suggestion
>
> I am still getting hard to resolve problems
>
> \define mymenubutton(color,icon,caption)
> <$button class="dropbtn" style="@@background-color:$color$">@@background-
> color:$color$;$icon$ {{$caption$}}@@</$button>
> \end
> \define showmenu(menuname)
> <$set name="currentMenu" value="[[$menuname$]]">
> <$set name=menufilter tiddler="$menuname$" field="menu-filter" emptyValue
> ={{$:/PSaT/MyMenus/menufilterdefault}}>
> <div class="dropdown">
>   <$macrocall $name=mymenubutton color="{{$menuname$!!color}}" icon=
> "{{$menuname$!!icon}}" caption="$menuname$!!menu-caption"/>
> ....
>
> In the above case I have the Caption working but not the icon and color
> The Icon returnes the correct name of the icon not the icon
> And if I remove the {{ }}  from the macro call they do not work as the 
> caption does
>
> I suppose the key difference is the tiddler name is in fact provided as 
> $menuname$
>
> Thanks,
>
> I will investigate with a fresh mind tomorrow.
>
> Tony
>
>
> On Thursday, January 18, 2018 at 3:18:49 PM UTC+11, Mark S. wrote:
>>
>>
>> Maybe like this:
>>
>> \define custombutton(color,icon,caption)
>> <$button style="background-color:$color$">@@background-color:$color$;
>> {{$icon$}} $caption$@@</$button>
>> \end
>>
>> <$macrocall $name=custombutton color={{ButtonInfo!!color}} 
>> icon={{ButtonInfo!!icon}} caption={{ButtonInfo!!caption}} />
>>
>> Using a tiddler ButtonInfo which has fields color=lightblue, 
>> icon=$:/core/images/chevron-down, and caption="A little blue"
>>
>> -- Mark
>>
>>
>>
>> On Wednesday, January 17, 2018 at 5:25:08 PM UTC-8, TonyM wrote:
>>>
>>> Hi Folks,
>>>
>>> A Question I have not being able to answer
>>>
>>> I have tiddlera calling a macro
>>>
>>> <<macroname tiddlerb>>
>>>
>>>
>>> The Macro is global ie tagged  with $:/tags/Macro
>>>
>>> In the tiddlercmacro tiddler I have
>>>
>>> \define macroname(tiddlername)
>>> <div class="dropdown" >
>>>  <button class="dropbtn">
>>>    <$transclude tiddler="$tiddlername$" field=caption mode=inline/>
>>>  </button> 
>>>  <div class="dropdown-content">....
>>>
>>> The Above is displaying the content of the caption field as the button 
>>> name - as wanted.
>>>
>>> However I have tried a number of things and can not seem to also do the 
>>> following.
>>>
>>> Display the icon from  tiddler="$tiddlername$" field=icon
>>> Colour the icon and caption from tiddler="$tiddlername$" field=color
>>>
>>> Thanks in Advance
>>> 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/87c9e226-2ad8-4232-9c67-f6faf23e65f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to