Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-12-07 03:41:10

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

[SOLVED] Vimeo iframe in a custom field not working

Wondering about this error I am getting. Placing a Vimeo embed code in an article’s body or excerpt fields works just fine, but not if I place the embed code in a custom field.

<txp:body />
<txp:if_custom_field name="content_type" value="video">
	<div class="flex-video <txp:custom_field name="Video_meta" />">
		<p><txp:custom_field name="Video_embed" /></p>
	</div><!-- end flex-video -->		
</txp:if_custom_field>

Safari inspector sees the output as a text node rather than an element, and the iframe in enclosed in "" quotation marks.

Anyone know of a solution to this?

Offline

#2 2012-12-07 03:53:05

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: [SOLVED] Vimeo iframe in a custom field not working

Note that with the above I’m using glz_custom_fields. Output for the video is:

&lt;iframe src="http://player.vimeo.com/video/36954078?badge=0" width="800" height="450" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen&gt;&lt;/iframe&gt; &lt;p&gt;&lt;a href="http://vimeo.com/36954078"&gt;Kom deg opp, Musikkvideo&lt;/a&gt; from &lt;a href="http://vimeo.com/user1041278"&gt;Solborg folkeh&amp;oslash;gskole&lt;/a&gt; on &lt;a href="http://vimeo.com"&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;

The quotations "" don’t seem to be getting parsed.

Last edited by jstubbs (2012-12-07 03:57:20)

Offline

#3 2012-12-07 07:27:35

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,172
Website GitHub Mastodon Twitter

Re: [SOLVED] Vimeo iframe in a custom field not working

maybe it will work if you add an escape attribute in the tag?

<p><txp:custom_field name="Video_embed" escape="" /></p>

Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2012-12-08 01:20:47

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: [SOLVED] Vimeo iframe in a custom field not working

Wow, learn something new every day. I didn’t know about the escape attribute for the custom_field tag. Solved! Thanks Yiannis!

Offline

Board footer

Powered by FluxBB