Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-04-04 18:09:50
- lisionosk
- Member
- From: Switzerland
- Registered: 2006-02-10
- Posts: 99
Renaming 'Category'.
Hi,
Would there be a way to rename the section ‘Category’ to ‘Series’ and also specify another page template than ‘Default’ for it to use ?
Offline
Re: Renaming 'Category'.
I think there’s a larger confusion at work here, so may I ask for you to tell us how your site is currently organized? How have you split things up, and what data has gone where?
I know that doesn’t actually answer your questions. But from a software-level perspective, there is actually never a section named “Category” (and thus it can’t be renamed) because sections and categories are different, if parallel, ideas. Furthermore, specifying which templates are used is done on a per-section basis, and category display doesn’t enter into that (at least not out of the box).
I don’t want to make recommendations at this point without getting some info from you first. But I can’t help thinking that, from what you’ve posted here, rearranging some things might suit your workflow better.
Offline
#3 2006-04-05 03:57:32
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Renaming 'Category'.
I believe he(?) is asking about changing the default template for category views, and renaming the word ‘category’ in the category clean urls.
Offline
#4 2006-04-05 07:03:31
- lisionosk
- Member
- From: Switzerland
- Registered: 2006-02-10
- Posts: 99
Re: Renaming 'Category'.
Exactly, Mary! Thank you.
The main content of my site consists now of a photoblog, some entries of which I would like to show in a section by itself called ‘Series’ (mock example). I thought the simplest way for me to do this would be to categorise some of the desired existing photoblog entries as ‘Series a’, ‘Series b’, ect, so, that in this false ‘Series’ section, I could browse pictures by series (which would really be disguised categories).
The only glitch is that the ‘Category’ name is not customizable, it’s not a section you can rename or specify a template for in the ‘Organise’ tab. For elegance, I would like to attempt renaming it to ‘series’, to have URLs that change from the default ‘urbangriffin.com/category/categoryname/entryname’ to ‘urbangriffin.com/series/seriesname/entryname/’.
I also need to specify a template as the default page is a static page.
I hope that helps, and I have explained the situation better ? I know these things don’t come out of the box, but it really seems to me the simplest solution to my needs for now, so, I was hoping for some tricks, or a plugin maybe ? Anyway, thank you for your attention. :)
Oh, and ‘she’.
Last edited by lisionosk (2006-04-05 07:08:32)
Offline
#5 2006-04-05 13:48:28
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Renaming 'Category'.
lisionosk wrote:
to have URLs that change from the default ‘urbangriffin.com/category/categoryname/entryname’ to ‘urbangriffin.com/series/seriesname/entryname/’.
To my knowledge that’s not the default url style (for articles it would be site.com/section/article-title), but with the plugin sgb_url_handler you can probably achieve this.
Also, the word ‘category’ in the url is in the language file, so you could find category => Category
and change it to category => series
. (then manually re-install the language file.)
Offline
Re: Renaming 'Category'.
This is what happens when I post when tired: clarity and sense get lost.
I was thinking that it might work to create a section called series and work from there, but I think the others have more sensible solutions than rearranging your site to work with the model. I hope things work out for you.
Offline
#7 2006-04-05 18:30:29
- lisionosk
- Member
- From: Switzerland
- Registered: 2006-02-10
- Posts: 99
Re: Renaming 'Category'.
Thank you, Elenita.
Els, I have opened the language file, found the exact line and swapped ‘Category’ for ‘series’, and re-uploaded. But I was wondering if there could be more editing than that to do ? The category links did not change, and remained as aforementionned. I tried posting a new entry to see if that would cause the appropriate links to rebuild themselves, but not.
Thanks for any more support that you can spare my way. ;)
Offline
#8 2006-04-05 18:35:08
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Renaming 'Category'.
You have to install the language file as well as just upload it. Admin > preferences > manage languages > install from file (bottom).
Offline
#9 2006-04-05 18:39:37
- lisionosk
- Member
- From: Switzerland
- Registered: 2006-02-10
- Posts: 99
Re: Renaming 'Category'.
Cheers to Els who just made my evening. Thanks!
Offline
#10 2006-04-05 18:58:47
- lisionosk
- Member
- From: Switzerland
- Registered: 2006-02-10
- Posts: 99
Re: Renaming 'Category'.
Ok, I really wanted to go from there on my own but…
Considering the default page template is a static page, the actual content being published in a subdirectory (with a custom page template I created for it), how do I, either, specify a special page template for the creation of the Category pages, or, insert code in the default template to allow for the generation of the Category content ?
Offline
#11 2006-04-05 21:56:20
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Renaming 'Category'.
If you don’t mind using the default page template, something like this in the page template is the easiest way:
<code>
<txp:if_category name=”“>
<txp:article form=”…” listform=”…” limit=”…” />
<txp:else />
here your static content
</txp:if_category>
</code>
As <txp:article />
is context sensitive, it will show only articles in the category that is requested. If there is no category requested (the home page) it will show your static content.
If you’d prefer a rather different layout, it might be better to use a different page template for the section your articles are in. In Presentation > sections you can assign a page template (and a style if necessary) to a section. On that page you can use the article tag as above. Because category lists use the default page template by default, you’ll have to code the links to the section page a little different. This example by Stuart will tell you how to do it.
Offline
#12 2006-04-23 10:18:32
- lisionosk
- Member
- From: Switzerland
- Registered: 2006-02-10
- Posts: 99
Re: Renaming 'Category'.
Hi,
I had set this aside as I really was having difficulties with it, but contrary to my expectations, I did not get any smarter in the interval, so here I am trying to figure this out again. Bear with me. ;)
I would like to display code snippets from my templates, but they won’t show: what is the way to have them displayed in my post ?
Last edited by lisionosk (2006-04-23 10:24:28)
Offline