Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-11-12 15:12:10

ductions
New Member
Registered: 2006-11-12
Posts: 2

Front page articles, different class.

Sorry if this has been posted before I wasn’t sure what to search for.

I’ve just started setting up my site with textpattern, and its easier than imagined it to be.

On the front page I will have 3 articles, the first (at the top) will be larger than the 2 below. How can I accomplish this in Textpattern?

To see what I mean go to my site.

I suspect it will be a case of changing the class of the div wrapped around the 2nd and 3rd articles but i have no idea how to do this with textpattern

Last edited by ductions (2006-11-12 15:14:17)

Offline

#2 2006-11-12 16:08:31

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Front page articles, different class.

You will need a means of separating the first from the second/third article. This can be achieved in various ways:

  1. txp:article supports three attributes, offset, pageby and limit which help to render multi part article lists. A example can be found in the corresponding Textbook page (Example 3).
  2. A conditional tag is an alternative way: txp:if_first_article.

As soon as you got the two parts separated, you can pass different form values into txp:article which will in turn contain the markup you wanted to use for the first and all subsequent articles (varying classes…).

Offline

#3 2006-11-12 18:30:15

ductions
New Member
Registered: 2006-11-12
Posts: 2

Re: Front page articles, different class.

Thanks for that, I used your first suggestion and it worked great!

Offline

Board footer

Powered by FluxBB