Hi Magnus,

There was a lot, lot more going on in your site than you indicated ;-)

After making a backup, drag, drop, and import the attached.

I've changed your image state tiddler to a regular tiddler and reference 
it's fields instead of using it as a data dictionary. You can change this 
if you want later, but you will have to make an action-setfield for every 
index you want to create, whereas doing it my way you only need one.

Part of the problem was that you were trying to do two things with one 
Button. You were trying to launch a modal, and you were trying to set (I 
think) field indexes.  You were also trying to do all that with a single 
string. Not sure if that's possible but it was an interesting approach To 
do two things at once, you need to use the "actions" attribute. The 
action-setfield widget will let you set multiple fields at once with one 
widget, so that's what I used. But it won't let you set multiple indexes in 
a data dictionary at once. 

I've turned off your old macro for now, but you can change things later if 
you want.

Have fun
-- Mark


On Sunday, December 23, 2018 at 4:29:32 PM UTC-8, Magnus wrote:
>
> Thanks for your suggestion but I can't get this either to work, the 
> photographer variable does not show 
>
> Den söndag 23 december 2018 kl. 23:49:17 UTC+1 skrev Mark S.:
>>
>> This is a case where you need to call a macro inside a macro, because you 
>> want to embed $photgrapher$ and then get the result and embed that. So 
>> there's two levels of concatenation.
>>
>> This works for me:
>>
>> \define lightBox(img, caption, photographer, template)
>> <$macrocall $name=lightBox2 img="$img$" caption="$caption$" photographer
>> ={{$:/_dictionary/photographers##$photographer$}} template="$template$"/>
>> \end
>> \define lightBox2(img, caption, photographer, template)
>> <$button message="tm-modal" param="$:/_template/lightBox"  set=
>> "$:/_state/currentImage" setTo="
>> img: https://raw.githubusercontent.com/magev958/Images/master/$img$.jpg
>> caption: $caption$
>> photographer: $photographer$">
>>
>> [img [https://raw.githubusercontent.com/magev958/Images/master/$img$.jpg
>> ]]
>> $photographer$
>> </$button>
>> \end
>>
>> <$macrocall $name=lightBox img="Motovun Jack.svg" caption="Myphoto is 
>> nice" photographer=tom template="stuff"/>
>>
>> You of course would call whatever your photographer's short name is ;-)
>>
>> -- Mark
>>
>

-- 
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/5ec5c719-8d94-470f-9cc6-f11d6e7a8605%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: tw_magnus_photo_gallery.json
Description: application/json

Reply via email to