Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: best way to output 5 articles on homepage
GugUser wrote #278733:
- You don’t close the HTML5 article tag.
- I can’t see where you call the form. If you call a form, then you have to use a single tag.
- Why you use
<txp:upm_article_image />
?- Strange behavior with the missing
<
. Do you begin withbc..
?
1: yes adding…
</article>
…helped. Now the article is outputted 30 times but it is better formatted ! Thanks
2. in my Home Page I have ( Section Home)
<txp:article_custom form="home_static" />
and in the “home_static” form i have:
<article role="article" itemscope itemtype="http://schema.org/Article" class="grid__cell unit-1-3 feature">
<txp:article_custom id="6" />
<h3 itemprop="name"> <txp:title /> </h3>
<p itemprop="image"> <txp:upm_article_image /> </p>
<div itemprop="description">
<txp:body />
</div>
</txp:article_custom />
</article>
3. old habit. i can use article image… but that is not affecting anything as it works perfectly fine. i.ie the imager is appearing fine.
4. bc. worked this time.
It strikes me that the tag
<txp:article_custom id="6" />
is not having any effect and that all my articles are being outputted multiple times.
Question how does the txp:article_custom id command know from which section to pull the info from?
…. texted postive
Offline
#14 2014-02-10 01:49:54
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,477
Re: best way to output 5 articles on homepage
Only call once <txp:article_custom id="6" form="home_static" />
.
And change te form home_static to:
<article role="article" itemscope itemtype="http://schema.org/Article" class="grid__cell unit-1-3 feature">
<h3 itemprop="name"><txp:title /></h3>
<p itemprop="image"><txp:article_image /></p>
<div itemprop="description">
<txp:body />
</div>
</article>
Offline
#15 2014-02-10 01:56:59
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,477
Re: best way to output 5 articles on homepage
If you use <txp:upm_article_image />
then you’re depending on an old and today unnecessary plugin. It could be that this plugin will no longer work with a future version of Textpattern.
Offline
Re: best way to output 5 articles on homepage
GugUser wrote #278736:
If you use
<txp:upm_article_image />
then you’re depending on an old and today unnecessary plugin. It could be that this plugin will no longer work with a future version of Textpattern.
right. and i know i was planning on stoping to using that plugin.
…. texted postive
Offline
Re: best way to output 5 articles on homepage
GugUser wrote #278735:
Only call once
<txp:article_custom id="6" form="home_static" />
.And change te form home_static to:
<article role="article" itemscope itemtype="http://schema.org/Article" class="grid__cell unit-1-3 feature">...
wow! that works!
But i would have never figured that out, as none of the documentation gives such an example. I know I am thick but …
Thank-you so much!, Having your example I will easily be able to add the other three article outputs.P.S. i now see that having one Form will be applicable to all Four articles as the command outputs the article by id :
<txp:article_custom id="6" form="home_static" />
Last edited by bici (2014-02-10 03:35:41)
…. texted postive
Offline
Re: best way to output 5 articles on homepage
I’ve added an example of this to the in-progress docs rewrite now
Offline
Re: best way to output 5 articles on homepage
philwareham wrote #278744:
I’ve added an example of this to the in-progress docs rewrite now
Yes. Well done! and with the added bonus of the if image tag:
<txp:if_article_image>
Many thanks!
PS speaking of images: on your github docs for article_image can an example be added using the timthumb.php.
Last edited by bici (2014-02-10 17:25:18)
…. texted postive
Offline
Re: best way to output 5 articles on homepage
bici wrote #278761:
PS speaking of images: on your github docs for article_image can an example be added using the timthumb.php.
This is done now, but I’ve added it to the txp:if_article_image tag reference which is the correct place for it.
Offline
Re: best way to output 5 articles on homepage
philwareham wrote #278811:
This is done now, but I’ve added it to the txp:if_article_image tag reference which is the correct place for it.
I am so looking forward to the new documentation …
…. texted postive
Offline