Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-03-03 21:24:51

thesheep
New Member
Registered: 2006-02-28
Posts: 8

More than one content area on a page

Hi, I’ve had a look through the FAQ and I don’t THINK it answers this question, but I might not have understood.

I’m wondering how TXP can be used as a CMS where I might have 2 or more separate areas of content on one page.

For example on the homepage I want to have a main column of text, then also have a sidebar with different text. I’d like to allow my client to edit both of these areas on that page, but there is no requirement to add new ‘articles’.

Should I somehow create 2 sections on one page, and have 1 article only for each section?

Offline

#2 2006-03-03 22:25:45

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: More than one content area on a page

Actually you could do it a few ways. Is this for a “front page”?

Offline

#3 2006-03-03 23:53:41

thesheep
New Member
Registered: 2006-02-28
Posts: 8

Re: More than one content area on a page

Hi, yes on the homepage I want to have 3 separate boxes of text, side by side, each one can be edited by the client.
On the inner pages I want to have 2 separate areas: a main column of text, plus a sidebar.
The content will always stay about the same amount, but the client should be able to change it.
What kind of options do I have to implement this?

Offline

#4 2006-03-04 00:18:40

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: More than one content area on a page

I would implement those boxes with content as articles.
I think it’s the best approach for you and your client.

You can call those articles (sticky) by using:
<txp:article_custom id="article id" />
or
<txp:article_custom status="sticky" sortby="Posted" section="thesection" limit="1" />

With the first one, your client will have to edit always the same article.
With the second one, your client will have the option to create a new article with new content, and that new article will replace the old one.
The advantage of this second approach is that old content is archived in the database…

So, you can have for your frontpage

<code>
<div id=“box1”>
<txp:article_custom id=“1” />
</div>
<div id=“box2”>
<txp:article_custom id=“2” />
</div>
<div id=“box3”>
<txp:article_custom id=“3” />
</div>
</code>

Or

<code>
<div id=“box1”>
<txp:article_custom status=“sticky” sortby=“Posted” section=“sectionA” limit=“1” />
</div>
<div id=“box2”>
<txp:article_custom status=“sticky” sortby=“Posted” section=“sectionB” limit=“1” />
</div>
<div id=“box3”>
<txp:article_custom status=“sticky” sortby=“Posted” section=“sectionC” limit=“1” />
</div>
</code>

Of course, in this second approach you need to have different sections for each article… or not! Because thee is a third approach…

<code>
<div id=“box1”>
<txp:article_custom status=“sticky” sortby=“Posted” section=“section” limit=“1” />
</div>
<div id=“box2”>
<txp:article_custom status=“sticky” sortby=“Posted” section=“section” limit=“1” offset=“1” />
</div>
<div id=“box3”>
<txp:article_custom status=“sticky” sortby=“Posted” section=“section” limit=“1” offset=“2” />
</div>
</code>

Notice the offset attribute in the tags. You can find more info in the manual: article_custom

Finally, I have no doubt that there is a fourth approach, and a fifth approach… in TXP you can do the same thing by following different methods.

Last edited by maniqui (2006-03-04 00:19:37)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#5 2006-03-05 09:25:26

thesheep
New Member
Registered: 2006-02-28
Posts: 8

Re: More than one content area on a page

Thanks for this. I think I’m beginning to understand more now. I will experiment with these.

Offline

Board footer

Powered by FluxBB