Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: anyone working on a category plugin ?
Ah, I’ll have to adjust the numbering scheme I came up with. it only allows 9 child categories. Probably fix it by adding another 2 or 3 zeros, and making the child category start further towards 1.
Instead of
230000gashtra
239000targah forest
use
23000000gashtra
23009000targagh forest
that will give me 999 sub-categories instead of 9.
I may have to adjust it several times more, so each level has more than 9 child categories. I’ll check into that when I get the chance. Probably not until next weekend.
And maybe use Open Office spreadsheet rather than paper…
Offline
Re: anyone working on a category plugin ?
To convert the category names to lower case in one go, use a database tool such as phpmyadmin (probably provided by the host) or a mysql GUI database editing program. First make a backup of your database and then do the following SQL query:
UPDATE txp_category SET name = LOWER(name);
You may want to repair the table index afterwards:
REPAIR TABLE txp_category QUICK;
Another advantage of using phpmyadmin or a mysql database tool (e.g. sequel pro on the mac or HeidiSQL for windows) is that you can edit multiple rows at once allowing you to add your numbers much more easily (rather like working in excel).
smd_where_used is useful for tracking down where you have hard-coded a certain string name in a page template, form or article. If you work methodically with one term after the other it’s a great help.
An alternative approach would be to export your database to an .sql file using export in phpmyadmin or your database tool. Again make a backup and work on a copy of the file and then edit it directly with a text editor. It needs doing with care so as not to ruin the mysql syntax. The advantage is that you can use your text editors search (and replace, providing you use it carefully) function to find other occurrences. Then import the changed sql file back into your database.
Note that all that is really only worthwhile if you really have a lot of categories/editing to do and using txp’s editing interface would be excessively laborious. It’s always safer to use txp’s own means of editing categories and forms.
TXP Builders – finely-crafted code, design and txp
Offline
Re: anyone working on a category plugin ?
I got about half done on Monday by using textpatern’s interface to renumber the category names. I’ll probably change the number to give me more than 9 sub-categories per level. Probably 999 for the first 2 levels, then 99, with 9 on the lowest level. I’ll have to go over it, and make the decision.
Offline
Re: anyone working on a category plugin ?
Busy working on a renumbering scheme. The only problem I see with this method is if I have to add a number of second level categories down the road. Below that level I made enough of a number spread so it shouldn’t be a problem there. Of cours,e if i have to renumber the nations on my site… everything below that will have to be redone.
Offline
#17 2010-02-19 20:44:36
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: anyone working on a category plugin ?
I admit that with your number of categories and sub-levels it’s not the most elegant and simple way, but unfortunately at the moment there is no other way to handle the sorting (except hardcode the entire menu, come to think of it that might even be less work…).
Offline
Re: anyone working on a category plugin ?
Well, I have used an across the top menu system from here: Freestyle menu But I cannot seem to get it to work with Textpattern. Probably its the js and css I need to place correctly.
Offline
#19 2010-02-19 21:45:43
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: anyone working on a category plugin ?
First get your menu to display what you want. Then it won’t be a problem implementing the css and js to make it look how you want :)
Offline
Re: anyone working on a category plugin ?
I have added the menu, but I had to add part of it to the defaultpage and archivepage as I couldn’t get the Server side include to work… SSI is enabled on my web hosts’ servers, I just couldn’t figure out how to get it to load on Textpattern.
edit:
It did take me a long while on my MT blog, so I am not too surprised… Plain html pages, I get it to work first time. I have placed the files for the menu in both the theme folder I am using, and in the root part of the cms.
Last edited by JimJoe (2010-02-19 21:50:23)
Offline
Re: anyone working on a category plugin ?
Runtime: 0.0579
Query time: 0.040321
Queries: 23
Much faster load time than 10 seconds.
Offline
Re: anyone working on a category plugin ?
you’re welcome.
Offline
#23 2010-02-24 02:30:58
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: anyone working on a category plugin ?
Bloke wrote:
It’s a kludge though, and I’d like to change this procedure in future TXP’s so you can add a category on-the-fly directly from the Write tab. Whether it’s possible remains to be seen.
That, and similarly being able to add a new image category while in the individual image tab (after uploading), would be a superb refinement. Something like the category drop-down selector accompanied by an input field saying “Select an existing category …or create a new one”.
I hope, you can figure out a way.
Last edited by masa (2010-02-24 02:34:49)
Offline