Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
How limit display in section_list ?
I Don’t know if there a plugin to make that rule :
I would like to limit the number of links within <txp:section_list />
like article’s limit attribute.
I need to use several <txp:section-list />
tags to display pages links within a two columns display. I need also <txp:section-list />
to exclude some sections in my links.
All your suggestions are welcome : plugin, PHP code, hardware, cooking advice etc…
Tks lot for your answers,
Regards,
Last edited by Pat64 (2007-07-31 07:26:53)
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: How limit display in section_list ?
There’s already an ‘exclude’ attribute for that tag and you can specify which sections you want to list in a comma separated list (‘sections’ attribute).
Offline
Re: How limit display in section_list ?
Tks ruud.
I know there is an attribute “exclude” for <txp:section_list />
I need to display into 2 columns the results of the link generated. I have to used this tag because I don’t know the number of section in the website I’m working on it.
So I would like to know how can I limit the number of the links displayed within <txp:section_list />
With some PHP code I’m sure you can make this rule…
Tks by advance for your answer ruud.
Have a good day.
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: How limit display in section_list ?
As I understand it, you have a variable number of sections and you want to spread them evenly over two columns, while excluding a few sections. Suppose the client creates 13 sections and 2 are excluded, then you’d want column 1 to contain 6 sections and column 2 to contain 5 sections. Is that correct?
Offline
Re: How limit display in section_list ?
Absolutely, Ruud. That’s it!
So I would like to use <txp:section-list />
twice : one for each column.
The problem is : cause the client can create all pages needed, I don’t know the number of sections (I’m training to customize each pages and forms to adapt it with all possible context!).
Second question. By default <txp:section_list />
tag show item’s list in alphabetical order. Is there a way to avoid this specific order (Seems this order is hard coded. So for what reason(s) Core Developers had choosed this default order)?
Tks lot.
Last edited by Pat64 (2007-07-31 19:20:09)
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: How limit display in section_list ?
In 4.0.5, the section_list tag has a sort attribute.
What you want requires you to set both a limit and an offset attribute as a percentage instead of an integer. It’s possible to create some PHP to do this… but it’s probably much easier and faster to manually enter the sections for each of the section_list tags in the sections attribute.
Offline
Re: How limit display in section_list ?
Absolutely… but I don’t know what section will be created.
Why I’m not a PHP developer?
So. I have to learn PHP. Can you tell me what is the best PHP book (in French cause it’s very hard to learn it in English).
Regards,
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: How limit display in section_list ?
I can’t recommend any specific PHP book, because I only own a single PHP book (not a very good one, I might add) and can find all the info I need in the PHP.net documentation, which is probably translated into French as well, but I already knew how to program in other languages… and that helps a lot.
Offline
Pages: 1