Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-10-13 05:59:24

thame
Member
Registered: 2005-06-07
Posts: 96
Website

Special Style for most recent article

How do I apply a special style or form to the most recent article? I don’t want the same article to appear twice on the homepage, just once within the special div, and then other articles listed normally.

Offline

#2 2005-10-13 06:16:56

tranquillo
Archived Plugin Author
Registered: 2005-03-07
Posts: 127
Website

Re: Special Style for most recent article

<a href=“http://thresholdstate.com/articles/3649/customizing-txp-recent_articles”>customizing txp:recent_articles</a>

Offline

#3 2005-10-13 13:11:18

thame
Member
Registered: 2005-06-07
Posts: 96
Website

Re: Special Style for most recent article

That’s a big help, but I just ran across another problem. The way my layout is designed has the latest article in a special style at the top, and the rest of the content is split into two sections.

It’s a little hard to describe…

How can I have the most recent article in a special style and ensure that the separate sections at the bottom of the page show the most recent articles without repeating the latest article or skipping an article.

Offline

#4 2005-10-13 15:07:31

domfucssion
Plugin Author
Registered: 2004-10-23
Posts: 39

Re: Special Style for most recent article

use txp:if_first_article to add the class to the main article and use it again in your other lists to hide it from the other lists on the page. This will skip an article from your other lists but it’s close.

Offline

#5 2005-10-13 15:18:58

thame
Member
Registered: 2005-06-07
Posts: 96
Website

Re: Special Style for most recent article

Hmm…

I don’t know if I want to skip any articles.

Should I just create a new section “latest” and do it all manually?

Offline

#6 2005-10-14 02:59:39

thame
Member
Registered: 2005-06-07
Posts: 96
Website

Re: Special Style for most recent article

I’d rather it work automatically though…

Offline

#7 2005-10-14 03:13:29

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: Special Style for most recent article

something like this?

<code>
<div class=“special”><txp:article limit=“1” listform=“first-article-form” /></div>
<txp:article offset=“1” limit=“15” listform=“list-article-form” />
</code>

Offline

#8 2005-10-16 00:57:35

thame
Member
Registered: 2005-06-07
Posts: 96
Website

Re: Special Style for most recent article

I still have no clue if it’s possible.

My content is split into two sections, so it isn’t possible (that I know of) to have the latest article styled differently while the two sections still display the proper content (ie. No repetition and no skipping articles)

Offline

#9 2005-10-16 05:11:02

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: Special Style for most recent article

thame — OFFSET is your friend, surely

maybe if you provide some further details or link to your page in development… ?

Offline

#10 2005-10-17 03:14:15

asarbogast
Member
From: Arcata, CA
Registered: 2004-05-21
Posts: 33
Website

Re: Special Style for most recent article

Thame,

I think I do something similar here. I ended up writing some Javascript to add the styling I needed to get the leaf to show up in the most recent post, since my homepage has 3 excerpts, one from each of 3 sections.

I use txp:article_id in the excerpt forms, hidden with CSS, to provide a hook for the Jacvascript to determine the most recent post.

Offline

#11 2005-10-17 04:30:16

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Special Style for most recent article

4.0.2 will have the new if_first_article and if_last article tags, which should help.


Alex

Offline

#12 2005-10-17 04:35:52

asarbogast
Member
From: Arcata, CA
Registered: 2004-05-21
Posts: 33
Website

Re: Special Style for most recent article

> zem wrote:

> 4.0.2 will have the new if_first_article and if_last article tags, which should help.

Yay! :)

Offline

Board footer

Powered by FluxBB