Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-11-28 23:12:40

vickilh
Member
Registered: 2007-10-30
Posts: 96

'Article Category Name' problem, removing hyphens, stw_category_tree

Hello!

My most simple question is: Is there some way to have the ‘Article Category Name’ be in the same format as the ‘Article Category Title’?

I recently upgraded from an earlier version of TXP, where the category name and title were formatted the same. All of my “old” migrated categories names are fine, they remained as they were. But with any newly created categories, the category names now get formatted like this: article category name: 01-My-Category article category title: 01. My Category

I.e., hyphens are substituted for spaces, etc.. Is there anything I can do to have my Category Name remain as I enter it?

I am using the stw_category_tree plugin, version 0.4. Everything is working fine with this old version plugin with my 4.0.5 TXP. I did try upgrading the plugin (just thought it might be a good idea), but everything went wild so I just quickly went back to the old version.

So I can’t use the “title=1” option with this plugin.

I’ve tried modifying the plugin, but without success so far.

Any help greatly appreciately!! Vicki

Offline

#2 2007-11-28 23:25:10

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: 'Article Category Name' problem, removing hyphens, stw_category_tree

You can ask questions about for that plugin in the stw_category_tree author support topic.

Offline

#3 2007-11-28 23:33:33

vickilh
Member
Registered: 2007-10-30
Posts: 96

Re: 'Article Category Name' problem, removing hyphens, stw_category_tree

Hello Rudd!

So there isn’t any way to affect how Textpattern is changing the format of the Category Name?

The problem isn’t really the plugin, it’s how TXP has changed how it’s handling Category names.

I can get around this by getting into the database and updating the ‘name’ field in the txp_category table. But hopefully there’s a better way!

Thanks! Vicki

Offline

#4 2007-11-29 07:58:12

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: 'Article Category Name' problem, removing hyphens, stw_category_tree

What you enter when creating a new category is not the name but the title. The name is derived from the title and doesn’t contain spaces, it contains dashes/hyphens. I’m not sure I understand the problem. Can you provide an exact description step by step of what you do and what you enter and what shows up?

Offline

#5 2007-12-02 15:28:36

vickilh
Member
Registered: 2007-10-30
Posts: 96

Re: 'Article Category Name' problem, removing hyphens, stw_category_tree

In earlier Textpattern, the category name was identical to the category title (i.e., NO dashes, etc..) It’s causing problems for me, having the spaces converted to dashes, etc. in the name. Can I change how TXP is writing this to the database table, so that the name will remain identical to the title?

thanks! Vicki

Offline

#6 2007-12-02 15:49:45

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: 'Article Category Name' problem, removing hyphens, stw_category_tree

You can only changing that by editing TXP core code, which is not recommended. If you want the title, use the title instead of the name.

What TXP version did you use before, because this has been the standard behaviour for quite some time?

Offline

#7 2007-12-02 17:03:36

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

Re: 'Article Category Name' problem, removing hyphens, stw_category_tree

vickilh
Title is what people see in the front end
Name is what is going to be part of the url which by its nature does not accept spaces.
THis was the case for as long as I remember which goes back to versionrc1

Last edited by colak (2007-12-02 17:05:42)


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 2007-12-02 17:05:43

vickilh
Member
Registered: 2007-10-30
Posts: 96

Re: 'Article Category Name' problem, removing hyphens, stw_category_tree

I upgraded from TXP 1.0.5.

What piece of TXP code is handling the spaces-to-hyphens, etc. conversion? I looked around but couldn’t find where this is being done.

thanks! vicki

Offline

#9 2007-12-02 17:27:52

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: 'Article Category Name' problem, removing hyphens, stw_category_tree

In earlier Textpattern, the category name was identical to the category title (i.e., NO dashes, etc..) It’s causing problems for me, having the spaces converted to dashes, etc. in the name. Can I change how TXP is writing this to the database table, so that the name will remain identical to the title?

Well, first of all, it ain’t valid to use spaces in the url, so you can’t name title and name to the same, as colak pointed out. And because of that it doesn’t allow any spaces.

If I remember right, in early versions of TXP, the renaming and corvensation ain’t used when category was saved, but when the tag was outputted, causing more phpqueries etc, when the tag was changed hyperlink-format when outputted. Now it done when the category is named or created, and the output-function only creates the link by given attributes.

So, why wan’t change it how it’s formed? It ain’t causing any good. You should change the stw_category_tree-plugins way to procude the tree’s link, and add there the correspond title using, by adding there category()-function or using same code as category-function does.

And what becomes your TXP version, 1.0.5. uh. It’s good that you updated, because that old version ain’t so up-to-date, nor secure for sure.

Cheers!

Offline

#10 2007-12-03 16:18:47

vickilh
Member
Registered: 2007-10-30
Posts: 96

Re: 'Article Category Name' problem, removing hyphens, stw_category_tree

I extended the smd_strip_numerics function in the stw_category_tree plugin to also replace hyphens with space. ALL (except only one recent) of the categories names in our system are identical to the category titles & working fine, so really no urgent need to change things at this point.

Yes, very good idea to finally upgrade! I just took over this website about a month ago on a PT contract, so I’m also still learning Textpattern. (- and not sure how much of my time I want to “donate” to my project to get fancier with Textpattern.)

Just got done migrating it off an old Windows server with old everything, to nice new Linux box with new everything. Well, except for having to do things like keep on using the old version of stw_category_tree. Perhaps not a terribly elegant way to handle things, but everything’s working. Perhaps as time goes on and I learn more about using Textpattern ….

Thanks!!! And Thanks again to Rudd, who helped me at various points in my migration!

Vicki

Offline

Board footer

Powered by FluxBB