Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-07-20 15:43:35

sebatorresi
Member
From: Spain
Registered: 2009-05-27
Posts: 105
Website

Events or articles on homepage

Hello!

If you go to the website ministerio vcn where is “actividades & enventos” (events) and “noticias & articulos” (news & articles) i want to put the events or articles from the blog, but i don´t want put any event or article. I want to choose the event o article to display on the homepage, something like the most important and the limit of 1 for each one.

I was traing with te excerpt but i can´t put “my selection” and the excerpt doesn´t display the article, i need help.

Thanks again
Seba


Sonríe | Smile . <txp:lover />

Offline

#2 2009-07-20 23:54:40

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: Events or articles on homepage

sebatorresi wrote:

…I was traing with te excerpt but i can´t put “my selection” and the excerpt doesn´t display the article, i need help.

Even if I don’t understand your last statement, I think you can achieve what you want using a custom field (it’s nicer with glz_custom_fields).
You can create a custom field named – for example – “homepage” and then, when you want an article to show on the home page, fill it with something like “actividades” or “noticias”.
Finally in the home page template insert:

 <txp:article_custom homepage="actividades" limit="1" />
<txp:article_custom homepage="noticias"  limit="1" />

Offline

#3 2009-07-21 07:40:40

sebatorresi
Member
From: Spain
Registered: 2009-05-27
Posts: 105
Website

Re: Events or articles on homepage

Thabks man buy i don´t understand what you mean…
I thought with categories is better. When i create the article for the blog only i have to put a categorie and this one display on the hompage, no?, but i don´t know how to creat this “code”.

Thanks


Sonríe | Smile . <txp:lover />

Offline

#4 2009-07-21 11:47:10

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: Events or articles on homepage

Ok, let’s try again.

1) you have two divs in the homepage called “#left_content” and “#right_content”
2) you want each to show only one article which you can choose
3) to achieve this you can use two article_custom tag (one for in each div).
4) the article_custom tag can be customized as you like to output a list af articles which satisfy a given condition.
I would use custom fields but if you prefer categories… that’s ok, it’s the same reasoning

here is a barebone example:

 <div id="#left_content">
<txp:article_custom  category="actividades" limit="1" />
</div>

and

<div id="#right_content">
<txp:article_custom   category="noticias" limit="1" />
</div>

I hope it’s more clear now

Offline

#5 2009-07-21 14:40:58

sebatorresi
Member
From: Spain
Registered: 2009-05-27
Posts: 105
Website

Re: Events or articles on homepage

I´ll try now… THANKS!

Is working!!!

Thanks mate!

Last edited by sebatorresi (2009-07-21 14:50:00)


Sonríe | Smile . <txp:lover />

Offline

Board footer

Powered by FluxBB