Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-02-13 23:21:14

camello
Member
From: Lisbon
Registered: 2006-01-15
Posts: 63
Website

Is here any plugin to assign any sort of priority to the articles.

I,

I’m, making a newspaper.

On my website www.diariocientifico.com, I have diferent kinds of Headlines (varying in size, image size, or text extension).

I want to assign articles a sort of “priority”, so an article which is a short importance small new, never get’s displayed on the most important Headline, and goes directly to the small headlines. And vice versa.

Is there any simple way of doing it? Maybe a plugin plugin to assign any sort of priority to the articles being displayed.

Thanks

camello

Last edited by camello (2006-02-13 23:24:30)

Offline

#2 2006-02-15 23:19:23

benbruce
Plugin Author
Registered: 2006-01-13
Posts: 328
Website

Re: Is here any plugin to assign any sort of priority to the articles.

How about using categories?

  • Have multiple categories for each type of article [for example, sports_hi, sports_med and sports_lo] and then when you have a sports story, assign it to one of those three categories.
  • On your article page, use <txp:article_custom category="sports_hi" /> to have hi-priority sports articles appear, etc. You can limit the amount that appear using the “limit” attribute, so if you only wanted the most recent, medium-priority story to appear, you could use <txp:article_custom category="sports_med" limit="1" />. If you wanted a page that was more complex, ie, a page that showed the most recent hi-priority sports story, the most recent medium-priority sports story, and the last three lo-priority sports stories, you could use something like the following:

<code>
<txp:article_custom category=“sports_hi” limit=“1” />
<txp:article_custom category=“sports_med” limit=“1” />
<txp:article_custom category=“sports_lo” limit=“3” />
</code>

  • Finally, you could assign forms to each of those categories, so that they were rendered differently [varying in size, image size, or text extension]. So then you’re final article page would look something like:

<code>
<txp:article_custom category=“sports_hi” limit=“1” form=“sports_hi” />
<txp:article_custom category=“sports_med” limit=“1” form=“sports_med” />
<txp:article_custom category=“sports_lo” limit=“3” form=“sports_lo” />
</code>

Offline

#3 2006-02-17 00:34:43

camello
Member
From: Lisbon
Registered: 2006-01-15
Posts: 63
Website

Re: Is here any plugin to assign any sort of priority to the articles.

Thanks a lot! That might be the way to do it…

I’m now doing something like that, but I’m just making lots of forms, and the I’m thinking about ordering the displaying by ading some article “costum field” with letter a ou b or c for importance, and inside each of the letters ill order the list by date.

I’m having a problem with the forms althogh, which i’m posting at the css discussion…

I’ll tell you how it went

Thanks

camello

Offline

#4 2006-05-02 19:58:56

baby
Plugin Author
From: Buenos Aires, Argentina
Registered: 2005-10-16
Posts: 95
Website

Re: Is here any plugin to assign any sort of priority to the articles.

Hi,

I’m a teacher and I’ve set up as a semester assignment for last year non-university students to ‘‘create a nice little plugin’‘ for txp.

I wanted to use a PHP open source project as the basis and txp showed up as the most interesting since it is:
  • quite stable
  • very well documented (for an open source project, at least) both in the user side and in the developer side
  • nicely prepared for user-contributed code

Since this request doesn’t seem too hard and it’s probably only client-side, I’ll probably assign it to a group of two or three students to develop. I’ll probably use a custom field as priority and use the content numerically. I’ll obviously post here the resulting plugin.

However, don’t hold your breath, since the semester ends by late July, and I don’t expect much code available before that…


Mariano AbsatzEl Baby

I don’t suffer from insanity. I enjoy every minute of it.

Offline

#5 2006-05-05 14:01:33

1ukaz
Archived Plugin Author
From: Buenos Aires, Argentina
Registered: 2006-05-05
Posts: 17

Re: Is here any plugin to assign any sort of priority to the articles.

Hi camello;

Maybe this is helpfull for you: create one custom Field as the Priority Field; once you do that when everyone wants to write an article, on the left side of the text area and under Advanced Options will have the priority field to complete. The condition to use this is to fill this field with values within 0 to 9.
After the values has been given to the articles you can use the tag:
<code><txp:article custom sortby=“custom_n”/></code>
where custom_n is the custom field that you declared as the Priority field. The only problem you will have with this is that if your writers use a number else than 0 to 9 values; those values will be ignored, but if you use the correct values always (0 to 9) it will work propertly.

Hope it helps

Last edited by 1ukaz (2006-05-05 14:14:49)

Offline

#6 2006-05-23 11:31:33

1ukaz
Archived Plugin Author
From: Buenos Aires, Argentina
Registered: 2006-05-05
Posts: 17

Re: Is here any plugin to assign any sort of priority to the articles.

Ok you wanted a plugin to sort the articles by something (Priority); here you have it !!:
This plugin will sort by a numeric field of your choice; or define a Custom Field as Priority and you don’t need to pass params to the tag. This first version doesn’t have a very good help, but I will fix it in the next few days….

EXAMPLES:

<txp:ort_article_psort /> >> Defaults; if you defined a Custom Field as Priority
<txp:ort_article_psort sortby="your_field" /> >> You already have a numeric Custom Field and want to order by that field
<txp:ort_article_psort sortby="your_field" /> >> Name a Custom Field as you wish and want to order by that field<br><br>

OPTIONS <br> status=“5” >> order fixed articles; default is published section=“some” >> get that section ordered by priority or by your Custom Field author=“author” >> get that author ordered by priority or by your Custom Field category=“MyCat” >> get that category ordered by priority or by tour Custom Field limit=“number” >> limit the amount of articles to be listed; default is 10 form=“form” >> changes de default form to list the articles sortdir=“dir” >> changes the direction of the ordering; default is DESC from higher to lower <br>

Go here to the plugin´s topic to download it.
Thanx

Last edited by 1ukaz (2006-07-04 14:52:29)

Offline

Board footer

Powered by FluxBB