Ed,

Perhaps an alternate strategy is to just copy the code ICKToz7BLLA the 
generate a link or two
In this case you could use [<code>addprefix[https://www.youtube.com/embed/]]

But you can also take the link and 
[{!!url}removeprefix[https://www.youtube.com/watch?v=]addprefix[https://www.youtube.com/embed/]]";

Regards
Tony

On Tuesday, July 2, 2019 at 10:40:54 AM UTC+10, Ed wrote:
>
> Sorry for the poorly worded title. Hopefully my use case will make it 
> clear what I am asking.
>
> I want to quickly add YouTube videos to my wiki by copying a link into a 
> text box. 
>
> I have a textbox/button that creates a tiddler and adds the text entered 
> to a url field:
>
> <$edit-text tiddler="$:/state/new-video-link" tag="input" default=""/>
> <$button>
> <$action-createtiddler $basetitle={{$:/state/new-video-link}} 
> text="{{||YoutubeTemplate}}" url={{$:/state/new-video-link}}/>
> Add
> </$button>
>
> The resulting tiddler calls a template (named "YoutubeTemplate") that will 
> display the video from the URL:
>
> <iframe width="560" height="315" src={{!!url}} frameborder="0" 
> allowfullscreen></iframe>
>
> The problem is that I need to use the 'embed' version of the URL.
>
> For example "https://www.youtube.com/watch?v=ICKToz7BLLA"; needs to become 
> "https://www.youtube.com/embed/ICKToz7BLLA";.
>
> Is there a method to 'find and replace' "watch?v=" with "embed/" when 
> calling {{!!url}} in my template?
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/6e1401dd-1b60-4103-ab6c-17b829ce0912%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to