How do I turn this into a macro (say called "video")

<div class="container"><iframe src={{!!url}} 
frameborder="0" allowfullscreen class="video"></iframe></div>

so that I can shoehorn it in here something like:

<$list filter="[tag[Video Collection - Foo]sort[title]]">
   <$button class="tc-btn-invisible tc-tiddlylink" message="tm-modal" 
param=<<video "currentTiddler">>>
      <b><$text text={{!!caption}}/></b>
   </$button><br>
</$list>

Many thanks for any help. I can't figure out macros :(

On Sunday, April 4, 2021 at 7:17:11 PM UTC+8 Sapphireslinger wrote:

> (Background: I found a hack for embedding responsive video at 
> https://www.h3xed.com/web-development/how-to-make-a-responsive-100-width-youtube-iframe-embed
> )
>
> I assume it is code bloat to keep pasting 
>
> <div class="container"><iframe src={{!!url}} 
> frameborder="0" allowfullscreen class="video"></iframe></div> 
>
> into every video tiddler. 
>
> So I put this in a tiddler tagged $:/tags/ViewTemplate and it works: 
>
> <$list filter="[<currentTiddler>tag[video]]">
> <div class="container"><iframe src={{!!url}} 
> frameborder="0" allowfullscreen class="video"></iframe></div>
> </$list>
>
> *But it broke this:* 
>
> <$list filter="[tag[Video Collection - Foo]sort[title]]">
>    <$button class="tc-btn-invisible tc-tiddlylink" message="tm-modal" 
> param=<<currentTiddler>>>
>       <b><$text text={{!!caption}}/></b>
>    </$button><br>
> </$list>
>
> Clicking a link still brings up a modal but there is nothing in it now. 
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d0d033a6-11c1-48fd-ba0a-51116df24baan%40googlegroups.com.

Reply via email to