Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-02-12 05:46:01
- capa
- Member
- From: Montana, USA
- Registered: 2005-09-10
- Posts: 20
"lead story" at the top of the page with photo
If you visit www.nytimes.com, you will see that there is a “lead art” photograph (largest photo at the top) with a link to that story.
I’d like to replicate this look using TextPattern.
Right now, I’ve sort of got it working with this:
<code>
<txp:article sortby=“Category2” limit=“1” />
<hr>
<txp:article sortby=“extract(year from Posted) DESC, extract(month from posted) DESC, extract(day from Posted) DESC, Category1” />
</code>
After the “leadart” story is listed, the other stories are then listed, sorted first by date, then by a Category1 (titled “important”)
Category2 in this case is called “leadart”, limited to one article. There will only be one article at a time flagged as “leadart”. When I have a new lead art article, I will deselect the old article as lead art, and select the new story as lead art. The old lead art story will then show up in the second list along with the bulk of the other stories.
This above method has a problem: the “leadart” story appears at the top AND again in the second list of articles. It shows up twice.
So I have two questions:
1) How can I arrange this so that “leadart” shows up only once? Perhaps there’s a better way to do this?
2) How can I have the thumbnail associated with the “leadart” article show up?
“I like the look of my own text.”
Offline
#2 2006-02-12 13:12:35
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: "lead story" at the top of the page with photo
- If the lead article is always the most recent post, and you are sorting the article list by date descending, you can add offset=“1” to the second article tag, so that it will skip the first one.
- At the moment there is no native txp tag for the article thumbnail, but you could use a plugin, for example wet_article_thumb.
Offline
#3 2006-02-12 21:32:08
- capa
- Member
- From: Montana, USA
- Registered: 2005-09-10
- Posts: 20
Re: "lead story" at the top of the page with photo
OK. This works now:
<code><txp:article sortby=“Category2” limit=“1” />
<hr>
<txp:article sortby=“Category2 DESC, extract(year from Posted) DESC, extract(month from posted) DESC, extract(day from Posted) DESC, Category1” offset=“1” /></code>
“I like the look of my own text.”
Offline
#4 2006-02-13 00:15:33
- capa
- Member
- From: Montana, USA
- Registered: 2005-09-10
- Posts: 20
Re: "lead story" at the top of the page with photo
Actually, this works even better:
in the page code:
<code>
<txp:article sortby=“Category2 DESC, extract(year from Posted) DESC, extract(month from posted) DESC, extract(day from Posted) DESC, Category1” />
</code>
and then in the form code …
<code>
<txp:if_article_list>
<txp:if_article_category name=“leadart”>
<txp:wet_article_thumb />
</txp:if_article_category>
<h3><txp:permlink><txp:title /></txp:permlink></h3>
<em><txp:posted /></em>
<txp:excerpt/>
</txp:if_article_list>
<txp:if_individual_article>
<txp:article_image />
<h3><txp:title /></h3>
<txp:excerpt/><txp:category1 />
<txp:body />
</txp:if_individual_article>
</code>
Last edited by capa (2006-02-13 00:17:42)
“I like the look of my own text.”
Offline