Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
YouTube thumbnails, as archive from main article
Is there a plugin that could help me out or is there any solution to my problem about this little problem.
Run down.
I have MAIN NEWS section, in which are articles written. Every article has a youtube video link inside of it, and its being displayed with the_video plugin from The Magnus.
Now, when that article is replaced with new one, I would like it to go down (see the image) in the previous videos section as just a thumbnail.
Problem.
I dont know how am I going to pull this of. As I understand there must be some relation from ‘main_news’ section and ‘archive_roll’. But isnt that impossible?
Problem is how do I make those thumbnails appear down there, when the current artcile is replaced with new one.
Link to image on ImageShack > http://img84.imageshack.us/img84/293/goalqp2.png
Im not entirely sure is this a HowTo or Presentation pr PlugIn section topic, so please move it if necessary.
“… they were enterprising voyages…” – Mr. Spock ( from Spock vs. Q )
Offline
Re: YouTube thumbnails, as archive from main article
I guess I solved this one too, but only half way trough.
The link for YouTube thumbnails looks like this > http://img.youtube.com/vi/*ID OF VIDEO*/default.jpg and there you have it. :)
“… they were enterprising voyages…” – Mr. Spock ( from Spock vs. Q )
Offline
Re: YouTube thumbnails, as archive from main article
Page template:
<txp:article form="recent" limit="1"/>
<txp:article form="past" offset="1"/>
Form: recent = the_video plugin
Form: past
<img alt="<txp:title/>" src="http://img.youtube.com/vi/<txp:custom_field name="video_id"/>/default.jpg"/>
(assuming the video id is input into a custom field)
Offline
Re: YouTube thumbnails, as archive from main article
Can I use the sam custom field for the_video.
For example
In the Presentation > Forms > main_news (as you have declared it form=“recent” in the previous post, as an example), I have
I have entered:
<txp:the_video from=“y” id=”<txp:custom_field name=“YouTubeVideoID” />” w=“404” h=“333” />
But I got:
Tag error: <txp:the_video from=“y” id=”<txp:custom_field name=“YouTubeVideoID” /> -> Textpattern Notice: Unknown tag attribute: name on line 653
I have tried to enter it into the article, but the same result was achieved, an error.
Im using TXP 4.0.6 and as I see there is no cusotm_field link on the left side, as there it is for:
* Permanent Link
* Posted
* Title
* Body
* Excerpt
* Section
* Category 1
* Category 2
* Article Image
* Comments Invite
* Author
ect ect…
“… they were enterprising voyages…” – Mr. Spock ( from Spock vs. Q )
Offline
Re: YouTube thumbnails, as archive from main article
<txp:asy_wondertag><txp:the_video from="y" id="<txp:custom_field name="YouTubeVideoID" />" w="404" h="333" /></txp:asy_wondertag>
Offline
Re: YouTube thumbnails, as archive from main article
I knew that asy_wondertag will come in handy some of this days. :D
“… they were enterprising voyages…” – Mr. Spock ( from Spock vs. Q )
Offline
Re: YouTube thumbnails, as archive from main article
As the solution sthmtc and jm gave me was great, I have to call out once again for your help.
The problem is when I type some other article, with different section assign to it, it displays in archive section (where should be only recent text from mainnews section ).
Is there a way to limit it to “read”, displays, only from mainnews section?
“… they were enterprising voyages…” – Mr. Spock ( from Spock vs. Q )
Offline
Re: YouTube thumbnails, as archive from main article
Is there a way to limit it to “read”, displays, only from mainnews section?
if_section in either your page or form template will work.
<txp:hide>page template</txp:hide>
<txp:if_section name="videos">
<txp:article form="recent" limit="1"/>
<txp:article form="past" offset="1"/>
<txp:else/>
<txp:article form="recent_text"/>
</txp:if_section>
Or in your recent form:
<txp:if_section name="videos">
<!--thumb-->
<txp:else/>
<!--text-->
</txp:if_section>
Offline