First, I would think that your things break because of your single quotes 
for the filter. When you type e.g

<$list filter="[tag[Foo]]">

...then whatever tiddlers are tagged Foo must not have any quote 
characters. To prevent this, use triple quotes, i.e:

<$list filter="""[tag[Foo]]""">


For your last question, to turn things into a macro etc, you can try this. 
I'm not really familiar with modals so maybe it won't work:

\define video()
<div class="container"><iframe src="$(url)$" frameborder="0" 
allowfullscreen class="video"></iframe></div>
\end

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

<:-)

On Wednesday, April 7, 2021 at 5:15:18 AM UTC+2 Sapphireslinger wrote:

> 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/16fe464b-e8f3-4962-8bc6-c50a0cb70044n%40googlegroups.com.

Reply via email to