Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-04-10 18:33:43

janvi
Member
From: Norway
Registered: 2009-05-28
Posts: 41

How do I make 'Featured articles' in a menu

Hello

How can I make featured articles in textpattern? I’d like to put this “Featured News” in a right side menu.
I know it’s possible with tags, but I’m kinda stuck here.

..ohh, and how do I accomplish articles in two rows on frontpage? I dont know how I can do this either..

I really appreciate all the help I can get.


Imagine a world in which every single person on the planet is given free access to the sum of all human knowledge.

The Future is Open – GNU/Linux

Offline

#2 2010-04-10 20:43:33

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: How do I make 'Featured articles' in a menu

You could make the featured articles Sticky, but that can bring some complications.

Better option is to install glz_custom_fields and make a custom radio field called ‘featured’, with a single value of ‘yes’ then plop featured="yes" into the article_custom code you use to build the menu.

Offline

#3 2010-04-10 23:09:12

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: How do I make 'Featured articles' in a menu

I have a similar need on a couple sites. On one, I have a category called “spotlight” that I use to indicate a featured article, and I use the category attribute in the txp:article tag to display featured articles. On another site, I use a method similar to what Stuart recommended.

Offline

#4 2010-04-11 00:05:14

luisrj
New Member
From: El Salvador
Registered: 2010-04-10
Posts: 5

Re: How do I make 'Featured articles' in a menu

An easy way is with keywords

<txp:article_custom keywords="featured" wraptag="ul" break="li" limit="5">
<txp:permlink><txp:title/></txp:permlink>
</txp:article_custom>

Just write “featured” or any word you might prefer inside the keywords field in the write tab and that’s it. To remove an article just remove the keyword.

About your second question (if i understood right) you’ll have to play with the <txp:article_custom/> tag. In a page you can only have one <txp:article/> tag but as many <txp:article_custom/> as you want. Use <txp:article/> for your main row and <txp:article_custom/> for the secondary and less important row.

A simple example:

<div id="main_row">
	<txp:article limit="10">
		<h2><txp:title/></h2>
		<txp:body/>
	</txp:article>
</div>

<div id="extra_row">
	<txp:article_custom limit="5">
		<txp:title/>
		<txp:excerpt/>
	</txp:article_custom>
</div>

Last edited by luisrj (2010-04-11 00:35:39)

Offline

#5 2010-04-12 20:50:14

janvi
Member
From: Norway
Registered: 2009-05-28
Posts: 41

Re: How do I make 'Featured articles' in a menu

Thanx, the Faq section at the TXP-main site helped me a lot.

Faaaantastic cms..


Imagine a world in which every single person on the planet is given free access to the sum of all human knowledge.

The Future is Open – GNU/Linux

Offline

Board footer

Powered by FluxBB