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 [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/12ded66a-7b2b-46e0-aada-88b098029123%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.