Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-05-13 14:06:51

jcr4runner
Member
From: Kissimmee, Florida
Registered: 2007-12-28
Posts: 18
Website

How do I alter links from the category list tag? <txp:category_list />

I have a pretty extensive website of about 1800 articles. The site has been up since 1996 and it’s become so unwieldy and outdated that I recently completed the arduous tasks of converting all the articles to TextPattern CMS.

I kept the same urls because many of the pages are well indexed. Most of the pages are not live yet, but the pages referenced below are.

I am trying to figure out the best way to convert my old index pages to the CMS. I am really new to Textpattern and have only been using <txp: …> tags for the past two days, so forgive me if this question has a simple answer that I am not seeing

I have created “articles” that act as landing pages that link only to the articles of that section or category.

For instance, I created an article called “apologetics” in the “forerunner” section and the “apologetics” category — and here I placed the following tag:

<txp:related_articles limit=“100” match=“Category1” section=“forerunner” sort=“Title asc” />

Here is the URL:

I made “forerunner” the parent of each forerunner section category (“apologetics” etc.) and I ended up with a page that has the following address and is syntactically the same structure as what I had before.

http://www.forerunner.com/forerunner/apologetics

This works beautifully. It creates a dynamic list of links to all the articles in that category in that section only. The list will automatically expand or contract to include any articles in that category that I add or delete. (I had to delete one article that my Indian worker and I both did because it appeared twice on the list.)

Then in the “forerunner” section I created a page called “testforerunner”

http://www.forerunner.com/forerunner/testforerunner.html

You’ll see on this landing page (actually an “article”) that all the links to the various categories that are grouped under the “forerunner” parent (under the categories tab) now appear on the page.

I placed the following tag:

<txp:category_list exclude=“forerunner” parent=“forerunner” this_section=“1” />

Here’s the snag.

The following tag: <txp:category_list exclude=“forerunner” parent=“forerunner” this_section=“1” />

produces a list of categories in the Forerunner section (“apologetics” etc) the snag is that the links are not produced the same way as the tag for the articles work.

Instead of getting a link to:

http://www.forerunner.com/forerunner/apologetics

which would lead to the apologetics landing page (or “article”) — I get a link that reads:

http://www.forerunner.com/forerunner/?c=apologetics

and this link leads to the root index of the “forerunner” subdirectory.

I was wondering if there is something that produces this “?c=” code.

If it could be eliminated then I could create hierarchical landing pages for various articles, categories and even a section index on the home page.

What do you know about this? Is this some type of PHP code that can be turned off? It’s odd that “?c=” is generated for categories and not for articles.


My published books on Lulu: http://lulu.com/spotlight/forerunner

Offline

#2 2008-05-14 00:32:05

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,303

Re: How do I alter links from the category list tag? <txp:category_list />

Jay, I presume that I find the actual core question of your article here:

Instead of getting a link to:

http://www.forerunner.com/forerunner/apologetics

which would lead to the apologetics landing page (or “article”) — I get a link that reads:

http://www.forerunner.com/forerunner/?c=apologetics

To me this sounds like either you or your indian worker accidentally tossed the switch for permanent link mode in the basic prefs over to “messy”. But I’m just a patient reader, somebody else might know better, now that the onion is peeled ;)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2008-05-14 03:31:29

jcr4runner
Member
From: Kissimmee, Florida
Registered: 2007-12-28
Posts: 18
Website

Re: How do I alter links from the category list tag? <txp:category_list />

No, I actually solved the problem shortly after I wrote this.

The permananet link mode is set to /section/title

(Sometimes it is good to write out what you mean in order to see what you are saying.)

Once I looked at the tags in my post, I realized I was REALLY creating landing pages that were “articles” not “categories.”

I had used the following tag to pull in article links in each landing page (actually an “article” not a “category” or a “page”)

<txp:related_articles limit=“100” match=“Category1” section=“forerunner” sort=“Title asc” />

So I realized that to create a list of links to my category landing “articles,” I just had to assign each landing page the same category in “category 2” and use the same code again except use <match=“Category2”>

<txp:related_articles limit=“100” match=“Category2” section=“forerunner” sort=“Title asc” />

This works. And best yet it keeps the syntax of the landing pages the same as before.

forerunner.com/section/category/title

I also had to create a “parent” for each category and list the parent in category 2.

I don’t know if this is the best way to do this, but it works. I am sure there are a half dozen better ways, but I am congratulating myself since I didn’t know what a <txp: …> tag was for 72 hours ago.

I just created a hierarchy of 25 index pages. Yeeha!


My published books on Lulu: http://lulu.com/spotlight/forerunner

Offline

Board footer

Powered by FluxBB