Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
best way to output 5 articles on homepage
Hi I am wanting to have a slideshow on the home page.
And under that I wish to have four articles ( the 4 articles will have links to four different sections, which will leave a different page of text and so I don’t want to use an excerpt and then a read more to the full body)
I want he user to be able to edit all content ; images and text.
So i am thinking that for the slideshow i should have a home_slide page and section with for custom_fields for the four images. this gives the user access to add change the pictures via the write tab. (( would disable the output of the default title for the slide show area.
For the four articles that are spread horizonatley across the page under the slide show i am thinking of a home_info page and section and output 4 articles with an image, to each of the four areas. But how do i restrict the output to the appropriate section … i am thinking that the out of articles would be limit=4 and then have the right article go to the right section.
does this make sense? doable? is there a better way.
Thanks for any suggestions
|------------------------------------|
| 4 slide show |
|------------------------------------|
| | | | |
| one | two | three | four |
|------------------------------------|
…. texted postive
Offline
Re: best way to output 5 articles on homepage
Check the slider and article list on this page which is pulling out articles from one or more sections, and the images I think are from the article image field. Can post the code if its close to what you need.
Offline
Re: best way to output 5 articles on homepage
Thanks for the offer. But i don’t see the four separate articles under the slider… or am i missing something.
I am looking to out put four articles from the same section. so i assume it has to be offset by id number or something.
i can easily figure out how to do this in EE but i can’t figure it out with TxP.
ie start the first article for ONE , then output to TWO (but omit the first article, then output to the THIRD but omit the first and second, then out put to FOUR but omit the first three articles.
…. texted postive
Offline
Re: best way to output 5 articles on homepage
Are you looking for offset
attribute?
<!-- you can wrap them individually -->
<txp:article_custom limit="1" offset="0" />
<txp:article_custom limit="1" offset="1" />
<txp:article_custom limit="1" offset="2" />
<txp:article_custom limit="1" offset="3" />
Offline
Re: best way to output 5 articles on homepage
@etc yes i think that will work. I was just not able to figure out that it would be an article_custom tag.
PS would this also work? i.e limiting output by “id”? <txp:article_custom id=“81” />
Last edited by bici (2014-02-07 17:35:12)
…. texted postive
Offline
Re: best way to output 5 articles on homepage
bici wrote #278707:
PS would this also work? i.e limiting output by “id”? <txp:article_custom id=“81” />
yes it would:)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: best way to output 5 articles on homepage
thanks!
I can’t get my head around the fact that I always seem to be struggling with txp tags even after ten years of working with it TxP. … one day.
PS i am so looking forward to a new book on Textpattern
…. texted postive
Offline
#8 2014-02-08 01:15:48
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,477
Re: best way to output 5 articles on homepage
bici wrote #278709:
I can’t get my head around the fact that I always seem to be struggling with txp tags even after ten years of working with it TxP.
Do you know the tag reference?
Offline
Re: best way to output 5 articles on homepage
GugUser wrote #278710:
Do you know the tag reference?
yes i do remember every once in awhile to check it. But i have found through experience that quite often the solution I need is not covered therein. But i also recognize it’s a failure on my part.
…. texted postive
Offline
Re: best way to output 5 articles on homepage
bici wrote #278711:
quite often the solution I need is not covered therein.
I’m gradually rewriting the documentation, including parts of the tag reference, so if you think important solutions are missing then let us know what they are and I’ll consider adding.
Offline
Re: best way to output 5 articles on homepage
So what i am doing wrong? at the moment it outputs every article in the DB and adds author fields and comments etc,
I only want one article to be outputted. i.e. article 6 , but i get every article and Author, Posted. Comments Date etc?? where is that coming from?
In my form Home_Static i have :
<article role="article" itemscope itemtype="http://schema.org/Article" class="grid__cell unit-1-4 news">
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 />
and i call the form
txp:article_custom form="home_static" />
In the home page it displays the article 3 times.
Also it doesn’t look like it parses the correct CSS layout for the article “6”
NOTE missing < in the above.due to textile,
…. texted postive
Offline
#12 2014-02-10 01:17:46
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,477
Re: best way to output 5 articles on homepage
- 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.
- What is this:
/txp:article_custom />
? - Why do you use
<txp:upm_article_image />
? - Strange behavior with the missing
<
. Do you begin withbc..
?
It seems to me a very chaotic code.
Last edited by GugUser (2014-02-10 01:23:31)
Offline