Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-02-06 19:26:10

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,120
Website Mastodon

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

#2 2014-02-07 00:54:14

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

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

#3 2014-02-07 03:58:20

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,120
Website Mastodon

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

#4 2014-02-07 08:25:10

etc
Developer
Registered: 2010-11-11
Posts: 5,393
Website GitHub

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

#5 2014-02-07 17:34:59

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,120
Website Mastodon

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

#6 2014-02-07 17:40:45

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,172
Website GitHub Mastodon Twitter

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

#7 2014-02-07 17:44:15

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,120
Website Mastodon

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

#9 2014-02-08 01:22:10

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,120
Website Mastodon

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

#10 2014-02-08 09:21:05

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

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

#11 2014-02-10 00:18:26

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,120
Website Mastodon

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

  1. You don’t close the HTML5 article tag.
  2. I can’t see where you call the form. If you call a form, then you have to use a single tag.
  3. What is this: /txp:article_custom />?
  4. Why do you use <txp:upm_article_image />?
  5. Strange behavior with the missing <. Do you begin with bc..?

It seems to me a very chaotic code.

Last edited by GugUser (2014-02-10 01:23:31)

Offline

Board footer

Powered by FluxBB