Macro parameters - those pesky brackets again

How do I use the transclusion of a field as a parameter to a macro?

I am trying <<displayICC {{!!pictureLink}}>> where pictureLink is a field in the current tiddler containing the string NSW-image-RAAHC3.

This works perfectly if instead of the transclusion, I use NSW-image-RAAHC3.

I have tried <$transclude $variable="displayICC" param={{!!pictureLink}} /> to no avail.

I know its a brackets thing but cant work out the correct combination.

bobj

As a guess I’d say the transclusion is not being “executed” in your macro and instead the text {{!!pictureLink}} is being passed to a img tag as is … you may need tyo share your macro code

:smiley:

I presume displayICC is working correctly, what is it? Macro, Procedure ?

The First form is illegal for the short form of the macrocall

  • If we want to use parameters outside literal values we traditionally (and still can) uses the macrocall widget.
  • The modern form is as you used above so I expect there is an issue with the macro you call or a value in the field.

Perhaps temporarily modify your macro to see if it displays what you are trying to give it.

If you control the macro you could change the parameter to the fieldname, not its transclusion eg <<displayICC pictureLink>> then have the macro retrieved the value from the named field in the current tiddler.

Is the name of the parameter used actually called param?

<<displayICC param:"This is a parameter">>

If not, you’ll want to use the parameter name:

<$transclude $variable="displayICC" srcImage={{!!pictureLink}} />

srcImage would be whatever the name of the parameter is that is specified in the procedure/macro/etc

@Brian_Radspinner , got it in 1, go to the top of the class.

Thanks a heap

bobj

That was my next guess :smiley: