Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-05-22 01:54:37

aliceaod
Member
Registered: 2011-07-11
Posts: 18

<txp:category_list> ?c= appears as the url

I’m trying to use <txp:category_list>. When I use it, all the URLs in the list look something like this: domainname.web/emporium/?c=jaggerspun-yarns

If the “?c=” is removed then the link works. How do I get rid of the offending “?c=”

Offline

#2 2014-05-22 08:38:46

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,529
Website GitHub Twitter

Re: <txp:category_list> ?c= appears as the url

the c part of the url is what is leading to the category, if you remove it there is no category!

can you post your code and tell us what is the desired link you want?

Offline

#3 2014-05-23 00:07:01

aliceaod
Member
Registered: 2011-07-11
Posts: 18

Re: <txp:category_list> ?c= appears as the url

Thank you. I have the preferences set to use not use “?=messy” in the admin>preferences. I have it set for /section/title

This is what I have in my form:

<h4>Product Categories</h4>
<txp:category_list parent="yarn" exclude="ebay,books,looms,shuttles,everything-else" title="1" children="1" wraptag="strong" break="">
<p><txp:if_first_category></p>
<h4>=<txp:category title="1"/>=</h4>
<txp:else />
<p><txp:category title="1" link="1" /></p>
</txp:if_first_category>
</txp:category_list>

<txp:category_list parent="emporium" exclude="yarn,jaggerspun-yarns,uki-cotton" children="1" wraptag="strong" break="">
<p><txp:if_first_category></p>
<h4>=Etcetera=</h4>
<txp:else />
<txp:category title="1" link="1" /></p>
</txp:if_first_category>
</txp:category_list>

It returns “domain.com/emporium/?c=jaggerspun-yarn” when I want it to return “domain.com/emporium/jaggerspun-yarn”

When I use this rss_uc_list, the links work perfectly (there is no “?=c” in the URL so it works).
<txp:rss_uc_list linktosection=“emporium” section=“emporium” offset=“1” parent=“emporium” children=“1” wraptag=“ul” break=“li” showcount=“0” class=“catlist” /> I’d use this but can’t figure out how to get it to display the children of parent categories like I can with <txp:category>.

Thank you for your help.

Edit: code presentation -gaekwad

Last edited by gaekwad (2014-06-03 10:52:15)

Offline

#4 2014-05-23 04:26:53

aliceaod
Member
Registered: 2011-07-11
Posts: 18

Re: <txp:category_list> ?c= appears as the url

What would be ideal and what I’m trying to achieve is to have a menu that lists the categories in the same exact way that they’re listed in the admin panel in the categories tab, including the count(s) with the option of hiding some of them.

Offline

#5 2014-05-23 05:39:10

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

Re: <txp:category_list> ?c= appears as the url

Re article counts you can download the mdn_count plugin

The reason categories have that url is because they are section sensitive (please someone correct me if I am wrong). I think that if you want clean urls you will need to change your code to

<h4>Product Categories</h4>
<txp:category_list parent="yarn" exclude="ebay,books,looms,shuttles,everything-else" title="1" children="1" wraptag="strong" break="">
<p><txp:if_first_category></p>
<h4>=<txp:category title="1" section="default" />= (<txp:mdn_count category='<txp:category />' />)</h4>
<txp:else />
<p><txp:category title="1" link="1" section="default" />  (<txp:mdn_count category='<txp:category />' />)</p>
</txp:if_first_category>
</txp:category_list>

The problem with the code above is that the category links might end up in pages without any listings if your articles use any other sections but the default one.


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 2014-05-23 07:44:00

aliceaod
Member
Registered: 2011-07-11
Posts: 18

Re: <txp:category_list> ?c= appears as the url

Thank you. I appreciate the time and effort to reply with a possible solution. I’ve spent way too much time on this so I’ve decided to just bag it. I will hard code in a menu so that it shows up in an unordered list like it does in the admin categories tab. It will be quicker, I think.

Offline

#7 2014-05-23 09:05:58

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

Re: <txp:category_list> ?c= appears as the url

The solution I offered above works if you do not have any other sections. If you do, clean urls will not work and the section="default" would need to be deleted. Don’t go for a manual solution unless you really have to


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 2015-03-08 04:51:52

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

Re: <txp:category_list> ?c= appears as the url

no one has answered the question … why does this form of url NOT work :
domain.com/emporium/?c=jaggerspun-yarn
i.e.why is the “?c=” being output but it fails to go to the category ?

I’am seeing the same thing and it fails to go to the category with great frustration.


…. texted postive

Offline

Board footer

Powered by FluxBB