Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-04-29 08:15:08

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Wildcard sections in Section List?

OK – so when making a section list I want 2 sections to appear 1 & 2, then the rest to appear in whichever order they come in.

I am sure I have seen a section wildcard like this ‘*’:

<txp:section_list sections="section1, section2, *"

Was I dreaming?

Sorry – I haven’t had time to test this – on the run

Offline

#2 2008-04-29 09:11:35

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Wildcard sections in Section List?

Yes, you were dreaming.

Offline

#3 2008-05-01 05:44:06

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: Wildcard sections in Section List?

Ha Ha – thought so :)

Offline

#4 2008-05-06 06:03:11

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: Wildcard sections in Section List?

nm… this is confusing me now… how can I do this?

I have 4 sections which must be in an certain order, and the others must follow on after.

At the moment I have: asection, bsection, csection, dsection etc… but when using clean urls – it obviously falls down.

These are the column names in the section table: name, page, css, is_default, in_rss, on_frontpage, searchable, title

Offline

#5 2008-05-06 06:54:22

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

Re: Wildcard sections in Section List?

Hi Tye,

Maybe one the sections plugins will help


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

Offline

#6 2008-05-06 07:57:05

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: Wildcard sections in Section List?

Thanks Colak – I’ll look at those later, because I actually re-did the site to use <txp:if_category> -but I can’t get that to work neither :((((

The following works fine for all the categories except for “Contact and About” which have a conditional tag around them – they output 2 article forms, presumably from the first article call and then the article call within the conditional tag.

I can remove the article tag from Contact – and thats fine – but the About uses a totally different layout and is just not working

Is there something I am missing?

<txp:if_category name="">

<txp:article limit="1" form="cs-article" />

</txp:if_category>

<txp:if_category name="Contact">

<txp:article limit="1" form="cs-article" />
<txp:output_form form="cs-contact" />

</txp:if_category>

<txp:if_category name="About">

<txp:article form="cs-about" limit="1" sort="posted asc" />

</txp:if_category>

Offline

#7 2008-05-06 08:23:18

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

Re: Wildcard sections in Section List?

I think that the reason they output is indeed because of <txp:if_category name="">.

Another – simpler way is to forget, calling the forms in your tags and use the “Override forms” in the write tab.


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

Offline

#8 2008-05-06 09:04:57

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

Re: Wildcard sections in Section List?

Try this:

<txp:if_category name="Contact, About">
<txp:else />
<txp:article limit="1" form="cs-article" />
</txp:if_category>
<txp:if_category name="Contact">
<txp:article limit="1" form="cs-article" />
<txp:output_form form="cs-contact" />
</txp:if_category>
<txp:if_category name="About">
<txp:article form="cs-about" limit="1" sort="posted asc" />
</txp:if_category>

Offline

#9 2008-05-06 10:24:09

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: Wildcard sections in Section List?

Wow:)

Thanks colak – I had totally removed form override from my memory after a bad experience and it would have worked in this situation, if it hadn’t have been for the sort=”“ which I needed… still good to remember to use in similar situations though.

redbot thank you, I didn’t even know you could use conditionals like that, it never even crossed my mind :)

Offline

Board footer

Powered by FluxBB