Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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

#4 2005-03-08 17:59:33

gonzo409
Member
From: Ohio
Registered: 2004-06-25
Posts: 50
Website

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

Re: How to make the 1st article different from the 2d and the 3d?

> Jaro wrote:

> Mary, could you please explain these tags with two limit values? I didn’t see them documented anywhere.

It is all here and here.

Last edited by kartav (2005-03-09 16:41:31)

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

Board footer

Powered by FluxBB