Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-12-01 20:04:31

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 811
Website

How to simplify a long video tag (embedresponsively.com) ... !?

How can I make this:

<style>.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style><div class='embed-container'><iframe src='https://www.youtube.com/embed//DF78EXv42c4' frameborder='0' allowfullscreen></iframe></div>

into something like this:

<txp:output_form form="youtube" url="https://www.youtube.com/embed//DF78EXv42c4" />

Keyword, custom field, variable, plugin … !? What’s the best way to make my client at ease?

Last edited by RedFox (2015-12-01 20:08:11)

Offline

#2 2015-12-01 20:33:11

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: How to simplify a long video tag (embedresponsively.com) ... !?

Go stock! young man.

Your form called “youtube”

<style>
.embed-container { 
position: relative; 
padding-bottom: 56.25%; 
height: 0; 
overflow: hidden; 
max-width: 100%; 
}
.embed-container iframe, 
.embed-container object, 
.embed-container embed {
 position: absolute; 
top: 0; left: 0; 
width: 100%; 
height: 100%; 
}
</style>
<div class='embed-container'>
<iframe src='<txp:yield />' frameborder='0' allowfullscreen></iframe>
</div>

Your Call

<txp:output_form form="youtube">https://www.youtube.com/embed//DF78EXv42c4</txp:output_form>

Offline

#3 2015-12-01 23:48:36

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 811
Website

Re: How to simplify a long video tag (embedresponsively.com) ... !?

Nice one mister Chapman … :)

Last edited by RedFox (2015-12-01 23:49:01)

Offline

#4 2015-12-02 08:46:20

milosevic
Member
From: Madrid, Spain
Registered: 2005-09-19
Posts: 390

Re: How to simplify a long video tag (embedresponsively.com) ... !?

You can also build a <txp:video/> tag with smd_tags smd_macro an your client should type:

<txp:video source="https://www.youtube.com/embed//DF78EXv42c4"/>

or, shomething more simple and ellegant

<txp:video id="DF78EXv42c4"/>

Last edited by milosevic (2015-12-02 09:58:03)


<txp:rocks/>

Offline

#5 2015-12-02 09:09:36

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,925
Website GitHub

Re: How to simplify a long video tag (embedresponsively.com) ... !?

milosevic wrote #296921:

You can also build a <txp:video/> tag with smd_tags…

I think you mean smd_macro.

You can also use Jukka’s rah_beacon with a variant of Dale’s form too (if you’re working on a recent v4.6 installation of txp, see this issue to get rah_beacon working again – make the changes in the vendors folder).


TXP Builders – finely-crafted code, design and txp

Offline

#6 2015-12-02 09:56:47

milosevic
Member
From: Madrid, Spain
Registered: 2005-09-19
Posts: 390

Re: How to simplify a long video tag (embedresponsively.com) ... !?

I think you mean smd_macro.

Yes! sorry, you are right.


<txp:rocks/>

Offline

#7 2015-12-02 17:35:35

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 811
Website

Re: How to simplify a long video tag (embedresponsively.com) ... !?

Of course … smd_macro … a wonderful plugin:

<txp:youtube url="https://www.youtube.com/embed//DF78EXv42c4" />

:))

Last edited by RedFox (2015-12-02 22:33:06)

Offline

Board footer

Powered by FluxBB