Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2019-01-14 09:53:16

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,595
GitHub Twitter

Strange behaviour with the section_list

With the “Simplr” theme (TXP 4.7.2) only the “Blog” page display the “Photography” section into the main left menu but disappears in the other pages.

https://pat.re/blog/

This menu is governed by a section_list tag with correct exclude and sections attributes in order to generate a desired list of items.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#2 2019-01-14 10:15:47

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: Strange behaviour with the section_list

Hmm, your currently published menu_main form doesn’t include “photography” in the list at all. I assume you’ve changed that online, but could it be something to do with the “preview” of your theme changes showing on that section only? I think you can see that in newer txp version on the Presentation › Sections panel. A wild guess, I admit. Maybe that changes when you change your site status.

BTW: I believe you don’t need exclude and sections at the same time in section_list. If you use sections those are the only ones that will show. If you use exclude (without sections) it should show all sections except the ones you exclude, which is more extensible for a theme template.

Also, as far as I remember active_class only works with (wraptag and) break set because it attaches the active class to the break tag. If you use your own markup, you need to include <txp:if_section name='<txp:section />' /> class="active"</txp:if_section> to insert the class against the currently active menu item.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2019-01-15 07:05:27

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,595
GitHub Twitter

Re: Strange behaviour with the section_list

Thank you Jakob for your answer.
Sorry for my late: I had an Internet access problem yesterday during all the half of the day.

It’s my fault: all is corrected now and Textpattern is a good CMS and it works perfectly :D

I did an error with my long list of main menu translations with a use of some <txp:output_form form='menu_main_<txp:lang />' /> tags.

As Phil pointed us: it’s pretty difficult to deal with themes and translations. May be all will be simplier when themes will allow the importation of translated strings included into a lang directory within the package.

Last edited by Pat64 (2019-01-15 07:23:23)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#4 2019-01-15 09:56:08

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: Strange behaviour with the section_list

Glad you got it working :-)

Re: language interfaces. You’re right, of course, that’s suboptimal, however in my view – unless you’re specifically designing a multi-language site – a theme doesn’t have to solve all those problems but should provide a framework for others to adapt to their own needs.

Your menu is a case in point: if you use exclude rather than named sections, then people can create and name their own sections and the menu extends or shrinks on its own accordingly.

Another approach, especially if you’re tied to particular naming conventions elsewhere in your theme, is perhaps to define a form with predefined site variables (I like to use oui_prefs for this but that too needs manual editing) that contains variables like menu_sections or similar section names for particular parts of the site, e.g. blog_section_name, gallery_section_name, etc. You then just need to instruct the user to set up those sections and adjust the variables for your theme to work with their preferred section names…


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB