Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2012-02-06 14:08:09
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 581
using txp tags in article body
I’m trying to put the following code in my article body but whenever I preview the article nothing is displayed.
<video poster="<txp:image id="31" width="358" height="269" controls preload>
<source src="<txp:site_url />files/video.mp4"></source>
<source src="<txp:site_url />files/video.ogv"></source>
</video>
Upon further investigation I found even a simple link such as <a href="<txp:site_url />download.txt">Download</a>
wouldn’t display.
If I remove <txp:image />
and <txp:site_url />
and replace them with absolute paths to the files everything works fine.
Last edited by Algaris (2012-02-06 14:09:55)
Offline
Re: using txp tags in article body
Algaris
Textile is probably fouling things up. Surround your <video>... </video>
with ==
or use notextile.
at the start and see if things improve.
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
Re: using txp tags in article body
try this
==<video poster="<txp:image id="31" width="358" height="269" controls preload><source src="<txp:site_url />files/video.mp4"></source><source src="<txp:site_url />files/video.ogv"></source></video>==
nb: bloke is faster
Last edited by Dragondz (2012-02-06 14:19:05)
Offline
#4 2012-02-06 14:24:11
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 581
Re: using txp tags in article body
Thanks Stef
I tried both ==
and notextile.
Neither of which worked. I then went into the Advanced Markup options and set both the Article and Excerpt Markup to ‘Leave Text Untouched’and still got the same results.
Offline
Re: using txp tags in article body
if the page online can you give us a link to see the result?
Offline
Re: using txp tags in article body
Algaris
Ah, also remember to close your <txp:image>
tag and poster attribute with />"
after the height attribute :-)
Last edited by Bloke (2012-02-06 14:33:13)
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
#7 2012-02-06 14:33:04
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 581
Re: using txp tags in article body
Unfortunately I’m on a virtual server that isn’t accessible outside my work premises.
Offline
#8 2012-02-06 14:35:48
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 581
Re: using txp tags in article body
Thanks Stef. I’ve replaced the line of code with: <video poster='<txp:image id="31" />' width="358" height="269" controls preload>
Still no joy though.
—Edit—
Doing ==<a href="<txp:site_url />download.txt">Download</a>==
works fine. So there must be an error with my code.
Last edited by Algaris (2012-02-06 14:41:24)
Offline
Re: using txp tags in article body
Weird, this works fine for me:
==<video poster='<txp:image id="31" />' width="358" height="269" controls preload>
<source src="<txp:site_url />files/video.mp4"></source>
<source src="<txp:site_url />files/video.ogv"></source>
</video>==
The problem is definitely a combination of using double quotes in double quotes (as returned by the <txp:image>
tag) and then throwing Textile on top didn’t help. The single quotes solved the former issue, and ==
solved the latter. It’s not obvious though!
Last edited by Bloke (2012-02-06 14:44:52)
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
#10 2012-02-06 14:48:36
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 581
Re: using txp tags in article body
Maybe it’s something to do with my servers configuration? I’m sure I had something similar working on our live site (on a different server) in the past.
Ah, here we go. http://example.com/film
—Edit—
I found that when I change the poster image to poster="<txp:site_url />images/31.jpg"
it displays the image but none of the video controls work.
Last edited by Algaris (2013-07-10 22:55:09)
Offline
Re: using txp tags in article body
Hmmm, maybe. But I’d have thought it was something else.
Does it work if you use single quotes round the poster
attribute? I had to check the source code to track the error down: Firefox helpfully highlighted the bogus output in red, which led me to the solution after a bit of trial and error.
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
#12 2012-02-06 14:59:03
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 581
Re: using txp tags in article body
No that doesn’t work either. I get the video controls all greyed out and no poster image.
Offline