Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-11-10 08:56:36

xylpho
Member
From: Brest, France
Registered: 2005-10-24
Posts: 28

List articles under sections with their category

Hello happy Txp people,
I spent many time to read the forum and search for plugins and now i’m a little confused for doing this simple task :
On my homepage, i want to see this :

Recently :

Analyse (section name)
  • Article (with parent category “Analyse”, same name of the section and display the child category too)
  • Article (with parent category “Analyse”, same name of the section and display the child category too)
  • Article (with parent category “Analyse”, same name of the section and display the child category too)

And again with another section.

I don’t know hw to make this task after spending many time to read and try. Please help…

Edit: Oh and I would have an automatic process of course, not doing this by hand

Last edited by xylpho (2006-11-10 10:33:31)


don’t eat yellow snow

Offline

#2 2006-11-10 15:23:30

xylpho
Member
From: Brest, France
Registered: 2005-10-24
Posts: 28

Re: List articles under sections with their category

Nobody???


don’t eat yellow snow

Offline

#3 2006-11-10 15:50:15

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: List articles under sections with their category

As far as I know child categories are nor supported off the box. You need a plugin. I’m sure that there is one but I just can’t remember the name. What I think that it will help you is the article_custom tag


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2006-11-10 19:28:31

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: List articles under sections with their category

I’m not entirely sure of what you’re describing. Perhaps this? or one of these?

Offline

#5 2006-11-11 09:35:38

xylpho
Member
From: Brest, France
Registered: 2005-10-24
Posts: 28

Re: List articles under sections with their category

Well i’m going to be very descriptive because this problem is a headache for me ^^
Plantages! (under construction)
The big horizontal menu is made wih cbs_navigation_menu and points only sections of my site
The structure seems to be weird for the rest of you but each section, for example “analyse”, contains only articles with the parent category “analyse”. The category “analyse” has many child categories. Right?
Now, on my homepage on the main column you have a “master” article (editorial), two articles (highlighted articles).
This result is done by the use of article_custom and handmade forms.
Now under these three articles, i want to see a title “Articles récents” (recent articles) AND below the name of each section of my site, and below each section title a full list of each live articles
In my section “Analyse” i’ve for example 13 live articles with parent category “analyse”. Certain articles can have a child category. Now visually:

Recent articles

Analyse (or any other section)

  • Sombres secrets dans l’isoloir électronique (article published under parent category “analyse” in “Analyse” section)
  • All other articles with the same requirements

And again with another section

Well i can do this by hand but an automatic process would be better for easy maintenance

Excuse me for my french


don’t eat yellow snow

Offline

#6 2006-11-11 13:06:40

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: List articles under sections with their category

Try something like this.

On the page:

<txp:article_custom form="article_list" limit="999" sort="Section asc, Posted desc" />

Form ‘article_list’:

<txp:if_different>
<h2><txp:section title="1" /></h2>
</txp:if_different>
<p><txp:permlink><txp:title /></txp:permlink></p>

The only problem might be the sort order for the sections…

Offline

#7 2006-11-11 13:29:25

xylpho
Member
From: Brest, France
Registered: 2005-10-24
Posts: 28

Re: List articles under sections with their category

Els wrote:

Try something like this.

On the page:

<txp:article_custom form="article_list" limit="999" sort="Section asc, Posted desc" />

Form ‘article_list’:

<txp:if_different>
<h2><txp:section title="1" /></h2>
</txp:if_different>
<p><txp:permlink><txp:title /></txp:permlink></p>

The only problem might be the sort order for the sections…

Thx Els, unfortunately doesn’t work. This system repeat sections twice or more :(
The sort order for sections doesn’t matter.
You can the the result on the site


don’t eat yellow snow

Offline

#8 2006-11-11 13:39:12

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: List articles under sections with their category

It looks like it’s not doing anything with the if_different tag… Which TXP version do you use? (Don’t know exactly when this tag was introduced.)

Edit: seeing that it’s not sorting by section, I wonder if you got the attribute right: sort="Section asc, Posted desc". Attribute sort was only added in 4.0.4, so if you’re using 4.0.3 you should use sortby="Section,Posted" sortdir="asc". (I’m not sure how to sort by section asc and posted desc.)

Last edited by els (2006-11-11 13:45:18)

Offline

#9 2006-11-11 16:13:23

xylpho
Member
From: Brest, France
Registered: 2005-10-24
Posts: 28

Re: List articles under sections with their category

yeah!!!! it works! sorry i didn’t mention that it was 4.0.3… Many thanks for your help. Now finding a way for excluding one section ^^


don’t eat yellow snow

Offline

#10 2006-11-11 18:01:49

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: List articles under sections with their category

xylpho wrote:

Now finding a way for excluding one section ^^

You can do two things:

1. Get the plugin chh_article_custom, you can use section="section1,section2,etcetera".

2. Set for all sections except the one you want to exclude ‘on front page’ to ‘yes’, and use <txp:article /> instead of <txp:article_custom />.

Offline

#11 2006-11-13 11:55:14

xylpho
Member
From: Brest, France
Registered: 2005-10-24
Posts: 28

Re: List articles under sections with their category

1. Get the plugin chh_article_custom, you can use section="section1,section2,etcetera".

I’ll give it a try ^

2. Set for all sections except the one you want to exclude ‘on front page’ to ‘yes’, and use <txp:article /> instead of <txp:article_custom />.

It’s already my situation. I know the differences between txp:article and txp:article_custom, and thhis one should work :
<txp:article category="edito" limit="1" form="excerpt_edito" /> but it doesn’t.
And this works
<txp:article_custom category="edito" limit="1" form="excerpt_edito" />

I don’t understnd because if i read correctly the documentation the first tag should work.

That seemed a simple case but that starts to be frustrating.

edit: oops, the first solution cannot work, sorry

edit2: ok, based on your solution Els, i wrote something which works. More than one line, but with one form.

<txp:article_custom section="analyse" form="article_list" sortdir="asc" limit="999" /> <txp:article_custom section="people" form="article_list" sortdir="asc" limit="999" /> <txp:article_custom section="politique" form="article_list" sortdir="asc" limit="999" /> <txp:article_custom section="societe" form="article_list" sortdir="asc" limit="999" /> <txp:article_custom section="humeurs" form="article_list" sortdir="asc" limit="999" /> <txp:article_custom section="futurisme" form="article_list" sortdir="asc" limit="999" /> <txp:article_custom section="loisirs" form="article_list" sortdir="asc" limit="999" /> <txp:article_custom section="intox" form="article_list" sortdir="asc" limit="999" />

No more headache for me and thanks your your help.

Last edited by xylpho (2006-11-13 13:01:25)


don’t eat yellow snow

Offline

#12 2006-11-13 23:29:03

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: List articles under sections with their category

…it was 4.0.3…

I recommend that you upgrade.

Offline

Board footer

Powered by FluxBB