Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-03-08 03:01:52

ABL
Member
Registered: 2010-03-08
Posts: 17

Would like to have 2 different formats for alternating articles

Hi! I would like to set up a system whereby I could have, for example, the odd numbered articles with the picture on the left and the text flush right next to it, and the even numbered articles with the picture on the right and the text flush left.

I imagine I could do this with categories at post time, but I would be thrilled if this could be done automatically, in case an article gets removed from the middle, for example.

Any help (including a kick in the right direction) would be appreciated.

Thanks!

Offline

#2 2010-03-08 04:12:53

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: Would like to have 2 different formats for alternating articles

How about using <txp:variable /> and <txp:if_variable /> in the appropriate article form to toggle between successive articles and the CSS classes that floats the image left and then right?

Last edited by joebaich (2010-03-08 04:16:33)

Offline

#3 2010-03-08 08:08:59

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,000
Website GitHub

Re: Would like to have 2 different formats for alternating articles

Here’s an article entitled fun with zebras by wet that explains the principle Joe means in more detail.


TXP Builders – finely-crafted code, design and txp

Offline

#4 2010-03-08 08:37:03

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Would like to have 2 different formats for alternating articles

ABL – the concept is explained here and a variation over here. Let us know if you need any more help.

Offline

#5 2010-03-08 16:25:26

ABL
Member
Registered: 2010-03-08
Posts: 17

Re: Would like to have 2 different formats for alternating articles

Thanks. Hopefully, between jakob and jstubbs, I can figure this out. Thanks, also to joebaich for getting the ball rolling and pointing me in the right direction!

Offline

#6 2010-03-10 00:58:52

ABL
Member
Registered: 2010-03-08
Posts: 17

Re: Would like to have 2 different formats for alternating articles

jakob’s link worked like a charm. Thanks, again.

Offline

Board footer

Powered by FluxBB