Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
bau_category1_title
Name: bau_category1_title
Author: Stephen Bau
Created: 2005-05-10
Version: 0.1
Download: bau_category1_title-0.1.txt
Info: bau_category1_title
Here is my second plugin for Textpattern.
I actually surprised myself by getting this to work. I ran into a problem with using two word categories in RC3 and checked out the latest version of RC3 in the Subversion repository. I saw kusor had been busy adding human readable category and section titles. Great timing, I must say.
With a couple new plugins: upm_category_title and upm_section_title, everything was working great, except for individual articles. Another plugin was needed, as indicated by this post on the Textpattern forum.
Necessity being the mother of invention, and imitation being the sincerest form of flattery, I created a Frankenstein plugin by taking a little bit from rei_show_custom and upm_category_title to come up with a plugin that does the bare minimum: output the category title from the new field in the txp_category table of the textpattern database.
Since there are two possible categories available for each article, there are also two functions available to the plugin:
txp:bau_category1_title and txp:bau_category2_title.
Last edited by bauhouse (2005-05-11 05:09:07)
Offline
#2 2005-05-11 05:31:49
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: bau_category1_title
Ah crap. I just added these to my plugin. :(
Ah well. Hopefully the built-in tags will be adjusted soon anyway.
Offline
Re: bau_category1_title
mary, if I new you were working on this, I would have waited.
For those who are looking for the feature-rich version (optional parameters: wraptag, id, class) of this basic plugin, check out mary’s upm_category_title plugin.
Offline
Re: bau_category1_title
Thanks Guy’s I actually reverted back to v326 because of the new title field not being output by any plugins. I use cat title frequently for navigational links. I will give this one a spin as well with newest subversion and see what happens. I guess I will have to go int sql and add the title field manually. Can I use this to make navigational sidebar links for cat?
Offline
#5 2005-05-12 01:42:57
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: bau_category1_title
“if I new you were working on this, I would have waited.”
Ditto. :)
Well, when you get upgraded, it automatically adds the title for you, it just uses the current “name”. Then, if you click on your category, you can change it to a nice title. When you create a category, it uses whatever you input for both, so then again it’s just click and adjust it one way or another.
“Can I use this to make navigational sidebar links for cat?”
‘fraid not. It would be simple to adjust category_list to use the title though. Same thing for section_list.
I’m thinking making a patch makes more sense for these things, but I don’t know how the devs want to handle the title information. Up ‘till now, it was just looking for and using the $s or $c variable.
Therefore, you either need to add the title information to autopopulate, or do what the plugins do and run another query. Running an extra query seems a waste to me. Maybe add to preText()?
Offline
Re: bau_category1_title
Thanks Bauhouse this works just fine and saved me a whole lot of tinkering myself, so great work and very useful right at the moment.
Hmm, Mary from what I have seen post 344 cat “Title” has not been automatically picked up from cat “Name” for me. I have gone back and forth a few times and looked at the db and new cats get appended, but existing cats stay the same until deleted and re-created and only then does the “Title” get populated. Unless there is something you know that I don’t, very likely, (god knows you have picked the source way more than me). I have been hacking on a few cat list plugs to see if I can tie into the new title field, but no luck so far.
Last edited by soulship (2005-05-12 01:55:54)
Offline
#7 2005-05-12 02:24:49
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: bau_category1_title
Ooh…
Okay, it adds the title field but doesn’t update it (it does that for sections, so I assumed too much). But, I can change the title just fine for old and new categories. It only displays the “name” on the organize page, so that may be contributing to the confusion?
Offline
Pages: 1