Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-12-25 14:02:37

Eugen
Member
Registered: 2016-12-25
Posts: 10

Menu category list links without ?c=

Problem:

Sections:
section
section1
section2

Categories: cat cat1 cat2

In the default section my menu category list linked to “category/cat”, “category/cat1”, etc. But if i have changed the section to other (section1, etc.), all links looks like “section1/?c=cat”, “section2
/?c=cat2”, etc.

The question: How i can set the “default category list look” for other sections (for example: in the “section1” linked to “category/cat”, “category/cat1”, etc.) ?

Last edited by Eugen (2016-12-25 14:03:17)

Offline

#2 2016-12-25 14:35:54

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: Menu category list links without ?c=

Welcome Eugen, I didn’t try it yet but this tip by jakob could help you; take a look at the reply to the second question.


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#3 2016-12-25 15:32:15

Eugen
Member
Registered: 2016-12-25
Posts: 10

Re: Menu category list links without ?c=

thanks for your answer! but i don’t need “clean url” for section links :-) i need only ones: all links in my category menu must be same for all sections, like so:

<ul>
<li><a href=”/category/me/”>Me</li>
<li><a href=”/category/you/”>You</li>
</ul>

My code for this menu:

<txp:category_list break=”“ wraptag=“ul” children=“0” class=“menu”>
<li<txp:if_category name=’<txp:category />’> class=“active”</txp:if_category>>
<txp:category title=“1” link=“1” />
</li>
</txp:category_list>

And if i go to section “/articles/” or open one article page “/articles/1/myfirstarticle/”, be same, and not so:

<ul>
<li><a href=”/articles/?c=me”>Me</li>
<li><a href=”/articles/?c=you”>You</li>
</ul>

Last edited by Eugen (2016-12-25 15:36:22)

Offline

#4 2016-12-25 16:45:03

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: Menu category list links without ?c=

Hello, try this:

...
<txp:category title="1" link="1" section="" />
...

Offline

#5 2016-12-25 18:05:50

Eugen
Member
Registered: 2016-12-25
Posts: 10

Re: Menu category list links without ?c=

@etc: thank you! what is it! i have tried “this_section” and “section” with different values, but not ‘ section=”“ ‘…

+1!

Offline

#6 2016-12-25 18:27:48

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: Menu category list links without ?c=

Eugen wrote #303410:

thanks for your answer! but i don’t need “clean url” for section links :-)

Ok, sorry I misundertood your request; glad that etc found the right answer (he often does!).

Last edited by NicolasGraph (2016-12-25 18:28:16)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#7 2016-12-25 20:15:20

Eugen
Member
Registered: 2016-12-25
Posts: 10

Re: Menu category list links without ?c=

@NicolasGraph:

no problem, i have seen helpful information in your answer too :-)

Offline

Board footer

Powered by FluxBB