Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2005-03-08 15:40:50
- kartav
- Member
- From: Moscow, Russia
- Registered: 2005-03-07
- Posts: 18
How to make the 1st article different from the 2d and the 3d?
Hi all,
I need to have on the main page 3 latest articles so as the latest article has one style and 2 more old articles have different styles(like here). Is there a way to do this automatically?
Thanks in advance
Offline
#2 2005-03-08 17:09:31
- fin
- New Member
- Registered: 2005-01-04
- Posts: 2
Re: How to make the 1st article different from the 2d and the 3d?
you should be able to do this with css …
http://www.w3schools.com/css/css_pseudo_classes.asp
use the :first-child css class for the style of the first article…
i have no idea if this works for internet explorer, though …
Offline
#3 2005-03-08 17:29:44
- kartav
- Member
- From: Moscow, Russia
- Registered: 2005-03-07
- Posts: 18
Re: How to make the 1st article different from the 2d and the 3d?
No no no,
I mean is where a way to a) get the 1st article; b) to get ‘from 2 to 4’ last articles through some template tags?
Offline
Re: How to make the 1st article different from the 2d and the 3d?
Maybe your looking for this
Liberal. Geek.
Offline
#5 2005-03-08 20:50:28
- kartav
- Member
- From: Moscow, Russia
- Registered: 2005-03-07
- Posts: 18
Re: How to make the 1st article different from the 2d and the 3d?
> gonzo409 wrote:
> Maybe your looking for this
Thanks for suggestion but I think it is not my case… What I need is structure like this:
‹div id=“latest”›
‹div class=“entry”›
… (body of article 1)…
‹/div›
‹/div›
‹div id=“under_latest”›
‹div class=“entry”›
… (body of article 2)…
‹/div>
‹div class=“entry”›
… (body of article 3)…
‹/div›
‹/div›
Is there a way to make this?
Last edited by kartav (2005-03-08 20:55:03)
Offline
#6 2005-03-08 21:38:20
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How to make the 1st article different from the 2d and the 3d?
I think you can do it with the chh_article_custom plugin.
For the latest article use <code><txp:chh_article_custom limit=“1” /></code>.
For the second: <code><txp:chh_article_custom limit=“1” offset=“1” /></code>.
And the third: <code><txp:chh_article_custom limit=“1” offset=“2” /></code>.
Offline
#7 2005-03-08 22:57:13
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: How to make the 1st article different from the 2d and the 3d?
You can do it without a plugin, using the built-in function, article_custom.
<txp:article_custom limit="0,1" />
<txp:article_custom limit="1,1" />
<txp:article_custom limit="2,1" />
All you need to do is create/modify the form(s) you want these three to use.
Last edited by Mary (2005-03-08 22:57:55)
Offline
#8 2005-03-09 07:37:17
- Jaro
- Member

- From: S/F
- Registered: 2004-11-18
- Posts: 89
Re: How to make the 1st article different from the 2d and the 3d?
Mary, could you please explain these tags with two limit values? I didn’t see them documented anywhere.
Offline
#9 2005-03-09 08:49:17
- kartav
- Member
- From: Moscow, Russia
- Registered: 2005-03-07
- Posts: 18
Re: How to make the 1st article different from the 2d and the 3d?
doggiez, mary
Thanks a lot for your help.
Offline
#10 2005-03-09 16:30:18
- kartav
- Member
- From: Moscow, Russia
- Registered: 2005-03-07
- Posts: 18
Offline
#11 2005-03-10 04:31:10
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: How to make the 1st article different from the 2d and the 3d?
Yes, the links kartav gave would be very helpful reference, should explain it very well. :)
Offline
#12 2005-03-10 07:19:55
- Jaro
- Member

- From: S/F
- Registered: 2004-11-18
- Posts: 89
Re: How to make the 1st article different from the 2d and the 3d?
Thank you. How could I miss zem’s documentation.
Offline
Re: How to make the 1st article different from the 2d and the 3d?
bump
I’m trying to do this (TxP 4.01), but it’s not working at all. My code is as follows:
<code><div id=“first”><txp:article_custom limit=“0,1” form=“entry_excerpt” section=“journal” /></div><txp:article_custom limit=“1,1” form=“entry_excerpt” section=“journal” />
<txp:article_custom limit=“2,1” form=“entry_excerpt” section=“journal” /></code>
But I get a blank page. Changing to <code><txp:article_custom limit=“1” /></code> works fine, so the function is returning something. Does v4 still work with the offset format for the limit attribute?
Edit: Never mind, found the answer. For anyone else’s future reference, use limit=“1” offset=“x”, where x is the number of articles to skip.
Last edited by Buddy Bradley (2005-10-13 12:57:12)
Offline