Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-11-13 12:48:38

carlahearne
Member
From: Milton Keynes, UK
Registered: 2011-11-13
Posts: 29
Website

Display section on all pages (Latest News)

Hi guys,

I want to display a Latest News section on all of my pages; is this possible? I’ve added a section called Latest with my articles in, and I’d like to show the most recent on every page.

Any help would be great,

Many thanks,

Carl

Offline

#2 2011-11-13 13:22:23

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

Re: Display section on all pages (Latest News)

Not difficult, you just need to use the article_custom tag to output content from your “Latest” section. Something like this:

<txp:article_custom section="latest" limit="5" form="your_form_name" />

Alternatively, instead of using a form, you could use the tag in container format:

<txp:article_custom section="latest" limit="5">
<txp:excerpt />
<p><txp:posted /></p>
anything else you want can go here...
</txp:article_custom>

If you use <txp:excerpt />, it has an enclosing <p> tag by default.

Edit: <txp:excerpt /> wrapped in p tags by mistake.

Last edited by jstubbs (2011-11-14 01:16:06)

Offline

#3 2011-11-13 17:43:35

carlahearne
Member
From: Milton Keynes, UK
Registered: 2011-11-13
Posts: 29
Website

Re: Display section on all pages (Latest News)

Thanks Jonathan,

The first tip worked a treat!

Cheers,

Carl

Offline

Board footer

Powered by FluxBB