Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-05-18 12:31:59

joel
Member
Registered: 2004-11-26
Posts: 162

Problem with flash video via Custom Field

Hi,

I’ve managed to insert flash-videos with a little help from the an7_video and asy_wondertag plugins.

The problem is that the player are shown in all articles that shares the same form, even though I use the chh_if_data plugin.

Here is my code:

<txp:chh_if_data>
<txp:asy_wondertag>
<txp:an7_video flv="<txp:custom_field name="video" />.flv" width="480" height="270" />
</txp:asy_wondertag>
</txp:chh_if_data>

All help are truly appreciated.

Thanks!

Offline

#2 2009-05-18 12:54:08

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,454
Website GitHub

Re: Problem with flash video via Custom Field

joel wrote:

The problem is that the player are shown in all articles that shares the same form, even though I use the chh_if_data plugin.

Observations:

  1. if you are using 4.0.7 or later you won’t need the asy_wondertag plugin
  2. if you’re not using 4.0.7 or later, why not?! ;-)
  3. chh_if_data looks at the entire contents of the container and determines if it returns anything or not. asy_wondertag may be returning something (even a space character is “something”!) which may cause it to return true
  4. if the custom field is not used, an7_video will try to load the file named: .flv which may or may not cause it to give a warning or fail in some way. This failure will be ‘seen’ by chh_if_data and that may trigger it to return true

Could you do this instead?

<txp:if_custom_field name="video">
   <txp:an7_video flv='<txp:custom_field name="video" />.flv' width="480" height="270" />
</txp:if_custom_field>

The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2009-05-18 13:06:50

joel
Member
Registered: 2004-11-26
Posts: 162

Re: Problem with flash video via Custom Field

Thanks for your quick answer.

Personally, I wanna update the system to 4.0.8 but I’m afraid I will run into problems since the site is using A LOT of plugins that might not work with the latest txp.

This might take some time and the client is not willing to spend more than neccesary (does this sound familiar?).

Isn’t there any short cuts for now… some sort of plugin perhaps?

Thanks!

Offline

#4 2009-05-18 13:08:15

joel
Member
Registered: 2004-11-26
Posts: 162

Re: Problem with flash video via Custom Field

This might do it http://textpattern.org/plugins/36/mdn_if_custom

I’ll give it a shot!

Offline

#5 2009-05-18 13:13:53

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,454
Website GitHub

Re: Problem with flash video via Custom Field

joel wrote:

Isn’t there any short cuts for now… some sort of plugin perhaps?

Well pre-4.0.7 you can still use asy_wondertag, just don’t use chh_if_data as well:

<txp:if_custom_field name="video">
   <txp:asy_wondertag>
      <txp:an7_video flv="<txp:custom_field name="video" />.flv" width="480" height="270" />
   </txp:asy_wondertag>
</txp:if_custom_field>

Last edited by Bloke (2009-05-18 13:14:46)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2009-05-18 13:20:03

joel
Member
Registered: 2004-11-26
Posts: 162

Re: Problem with flash video via Custom Field

Sweet! If I ever go to Coventry I look you up and buy you a pint!

Thanks a lot!

Offline

Board footer

Powered by FluxBB