Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2010-07-09 20:36:12

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,622
Website

Re: smd_write_cats: create categories on the fly from the Write tab

uli wrote:

Seems like it has to do with the vanilla link-category “Textpattern”.

/Stef slaps forehead.

I forgot to add the type to the category. What a doughnut! I swear I added that but must have deleted it by mistake as I messaed around with the code.

I’d prefer to write it Kermit-->Muppets, read: category Kermit goes into category Muppets.

Weirdo! :-p

I’ll see what I can do.

Last edited by Bloke (2010-07-09 20:36:55)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#12 2010-07-10 07:44:36

monkeyninja
Plugin Author
From: Sheffield, UK
Registered: 2008-10-14
Posts: 238
Website

Re: smd_write_cats: create categories on the fly from the Write tab

uli wrote:

Stef, if you work on adding nested categories, separator prefs etc:
I’d prefer to write it Kermit-->Muppets, read: category Kermit goes into category Muppets.

Is it possible to have a separate pref for exchanging the order of mother and child categories fields?

Could have it work like Kermit<Muppets for child followed by parent or Muppets>Kermit for parent followed by child. This is kind of what I had in mind with my form of notation. I suspect it complicates things a bit with Stef’s move towards a preference though.

Offline

#13 2010-07-10 07:54:14

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,622
Website

Re: smd_write_cats: create categories on the fly from the Write tab

monkeyninja wrote:

could have it work like Kermit<Muppets for child followed by parent or Muppets>Kermit

Hadn’t thought of that but Uli seems to want the parent at the ‘point’ end of the greater-then/less-than symbol so neither of the above will satisfy him :-)

I’ve implemented a pref for choosing the parent-child delimiter and also a pref for the order of items (child_first: 1 or 0).

Just running it through some rigorous tests as I don’t want to be responsible for corrupting someone’s category tree. Will try and release it later today / tonight.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#14 2010-07-11 12:58:06

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,622
Website

Re: smd_write_cats: create categories on the fly from the Write tab

After a slight delay, here’s v0.20. You should upgrade to this version immediately as v0.10 had some quirks that may cause problems in your category table (knew the plugin was too easy last time!)

Now:

  • Added parent->child creation
  • You can specify the parent-child delimiter via a hidden pref
  • You can switch the parent-child link order if you wish via a hidden pref
  • Only users with appropriate catgeory privs can add categories (thanks Uli)
  • Made internal tests case insensitive so you can’t create duplicates
  • Improved efficiency: fewer database calls and it’s still less than 100 lines of code
  • Prevented ‘root’ from being created/displayed
  • Set class of input box to Edit (thanks Uli)
  • Fixed stupid oversight with category types so they only consider articles (thanks monkeyninja/Uli)

Be aware that v0.10 will have erroneously created category names that are of mixed case. v0.20 forces lower case names (titles are unaffected). Now, when you type in ‘MY New CaTEGoRy’ the plugin uses that as your category title but ‘my-new-category’ as its name. I recommend you leave it this way and let the plugin assign lower case names on your behalf. It may be prudent to check your categories, especially those created by v0.10 and make them lower case.

Note that if you really want mixed case names you can use TXP’s interface to re-edit the names but I strongly advise against this: for starters you probably won’t be able to assign cats using this plugin because it won’t ‘find’ them. I consider the fact that categories can be altered to use mixed case a TXP bug, but I don’t know how everyone else feels about this or if there’s a good reason why it’s permitted.

Anyway, see how you get on with this version.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#15 2010-07-18 12:33:28

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

Re: smd_write_cats: create categories on the fly from the Write tab

Stef, many thanks for implementing the parent child order thing, and sorry for not responding earlier. I’d hoped to find time for in detail testing, but still couldn’t do so.


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

Offline

#16 2012-05-31 18:06:27

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,251
Website

Re: smd_write_cats: create categories on the fly from the Write tab

I’d love something like the for the Images tab and Image Categories.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#17 2012-05-31 19:25:48

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,622
Website

Re: smd_write_cats: create categories on the fly from the Write tab

MattD wrote:

I’d love something like the for the Images tab and Image Categories.

Hmmmm, no reason it couldn’t be extended I suppose. Let me sleep on it. Though the plugin name might need a rethink.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#18 2012-06-11 15:39:01

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,251
Website

Re: smd_write_cats: create categories on the fly from the Write tab

Stef, Is this an easy change to support images? I took a look at it but I couldn’t figure it out…


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#19 2012-06-12 10:09:05

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,622
Website

Re: smd_write_cats: create categories on the fly from the Write tab

MattD wrote:

Stef, Is this an easy change to support images?

Reasonably so. Please report if the beta v0.30 works ok for the other content types. The only reason it’s not official yet is because it only half works on the Write tab under SVN. Gotta talk to Robert about something first.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#20 2012-06-13 17:40:19

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,251
Website

Re: smd_write_cats: create categories on the fly from the Write tab

It doesn’t appear to be working for images. When I enter a new category and save the image the image shows in the list with the correct category but when I click edit again the category is blank and the new category does not exist in the dropdown or on the category tab.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

Board footer

Powered by FluxBB