Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2010-09-19 15:13:11

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: Categories choice linked to section choice - backend

JimJoe wrote:

So, section 1 would be the state name, and section 2 are the town names ?

Ehm.. I fear I don’t understand.. this plugin hides categories depending on which section is selected while I suppose you want to hide items from category2 depending on which category1 is selected, right?
This should be doable hacking the plugin, but in your case it would still be an huge work with more than 150 categories to be handwritten in the code (!).

edit
Pascal was faster

Last edited by redbot (2010-09-19 15:15:26)

Offline

#26 2010-09-19 15:20:53

JimJoe
Member
From: United States
Registered: 2010-01-30
Posts: 573
Website

Re: Categories choice linked to section choice - backend

Correct. When I select a state for category one, I want only the towns in that state to show up in category 2 when I am writing an article.

So, that would work for me, if it works on the Admin-> write article page.

Offline

#27 2010-09-19 15:31:01

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: Categories choice linked to section choice - backend

JimJoe wrote:

…So, that would work for me, if it works on the Admin-> write article page.

Yes that would work but, as I said before, you’ll have to write another (similar) plugin or hack it (sorry I can’t do it now).

Offline

#28 2010-09-19 15:32:20

JimJoe
Member
From: United States
Registered: 2010-01-30
Posts: 573
Website

Re: Categories choice linked to section choice - backend

Oh, and the site is huge already… so a bit of typing and editing won’t be a big deal. It will just take me some time to do… maybe longer than I expect, but I think I can handle it. I just need to know what to do.

Offline

#29 2010-09-19 16:59:47

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: Categories choice linked to section choice - backend

JimJoe wrote:

…I just need to know what to do.

Jim,
That means I should explain you how to modify the plugin (which is something different than just configuring it)?
Sorry I haven’t the time now and it would take more time to explain than doing it myself for you.
When I can, of course.

Offline

#30 2010-09-19 17:05:59

JimJoe
Member
From: United States
Registered: 2010-01-30
Posts: 573
Website

Re: Categories choice linked to section choice - backend

No problem. I’m kinda busy this weekend to.

Offline

#31 2012-08-27 20:00:43

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Re: Categories choice linked to section choice - backend

If you could update bot_cat_per_section_hide to work in TXP 4.5, I’d put some loose change in your can if I could find it.


BB6 Band My band
Gud One My blog

Offline

#32 2012-08-27 22:38:33

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

Re: Categories choice linked to section choice - backend

Peter, indeed, seems that it doesn’t work. Well, try this:

# Name: bot_cat_per_section_hide v0.1 [patched]
# Hide categories based on the section
# Author: 
# URL: 
# Recommended load order: 5
# .....................................................................
# This is a plugin for Textpattern - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the "Install plugin" box:
# .....................................................................

H4sIAAAAAAAAA41WbW/bNhD+LP2Km2dAcuColuwkrRwP6YoN+zLsQwr0Q1AItEhZTGVSEKW4
RuH/vuOL/FLH2QADIo/P3XN3vOOZpPEs/aHSWToQZM0Gc5UmuF7KNstJm9WsyRTLWy5FVnJq
zu/SwQtrFIr0bpoOJlGsV7fpgHRtKRu9maQD/YknvTDrGn58EKcDylTe8LrtLaGBv5ADkJit
ZMOZgiVRjIIU0JYMnCMaiy6WrKqPDKIkl9bB+OYWvfJ9wTZwKZBwNPf9vCJKXYTAD9/33l1d
+R5cwScpVNt0eSsbvX/ne75Xd8uK51B0wihBluU9Khyhtuc1bMVVi3ZzUlVLkn8LSdOQbThs
S67GEKgWZcEIV4SuucgU0ga4KxmhGRM0QC//h5UNqf/LyO4olt87XlEgIE3qFRgvLkZlTl08
q0ouSQXDSynT3uJvKLsWFmC9HDlhIRtG8jK0zo8uGwGiYOgEsPgNhq4ettYHY/2pB3xFHiqz
ChMUHoCacmdpWV5KsHWWPasweCHN5RtfQBA9K9wxoYsp1FSjKJi7FHqHHD5izo8K9XL2EOeS
N3xWSHB/f//HP3+aOEIq827NBFJgaug27LWcgudpZzFva9SzAi+PIYVhGPzax3odB6Mor6TA
kh47TPIzJjlgDGQ3N589hwv+rWt1aDSrWIVnT/q5WDy6W9D2SyJW7DwGQ2DIdRSO2QhfsJQW
6Kgu41GEO1srPZXHi3AYtduahdqJJwR8HcEvC7ykTlBWcMGwtnsWbxiZ8tLpGu/zH35j2zHI
5fMB5xlfnvBA146Gm3Wfn/k5LEIqGga2XTDSglfYja9E6ulebbtGwDDi4qNt0uPwxvBTJNfx
nm+nq2AtX4582PWrnf2wSrE9V59SHcEp7JBhe1X4gi4Oaq8WkPWuh7xaPwbieE6u6cxY2a6r
0LgX5bHdjax+7w/K+9DOeI61kwvaidPe7cvOCnTCsLvwaT9rfOw+28T4Erp5oUvLzIt0MNXf
m3QgG8oaJ7txsqIiK+VkE/19j6rse1vju3g80RCK77PcZNrnzI4nnk6sgt5mDdkYm3eoUsbR
xX7z/TqCjwLMe36t33Ooq27Fhb5s+Gy4WyxBAZ/+foxAD00FXxreIo4IVgXqjRnqKsLxRfBZ
Ao6tgq+6hhmIpRrDVnawkZ0eFRTxcs32QGLetgo7UEErNfLELc1vkFFd1oDtwpBmbxnY9xrJ
FU4gN0+wVDlZVgz0m0Lh4eJoeBhrwy3hgosVEGFHTOT7yzx6Y6D0o8j3AiePAz1Zgr7w4nGf
sG0SjA+wxMLwjwTOWUwyXwk81n8d8IK+lMxl7KG3+oA+0RNRgiKHIkVxkno02aNzuV6Ta8Vq
gqlFBFZ7h6nVmhgAZeLoPiP3r2tNTYFOk3SQvJ/EM0qnH2a3yQ2NC0ondx8KXE+Xs2nBsGh3
/wKj/EHN6AkAAA==

There you go. I rewrote it for you and fixed all the other potential issues, including 4.5 compatibility.

I will have to warn you about one thing, tho. It doesn’t take into account partial async updates. But as of now, no plugin uses partials to update categories on the fly. If such plugin lands and you end up using one, the above needs some refactoring. Currently it expects that the categories are handled as static elements (which they are by default).

Last edited by Gocom (2012-08-27 22:38:45)

Offline

#33 2012-08-28 12:11:58

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Re: Categories choice linked to section choice - backend

Jukka, you’re da man! Thank you! It works well. Nice that you separated the memorable spot where you enter the sections and categories from the plugin itself. Loose change heading your way which can be increased…

if you can add options in the Categories panel to If selected

I would like options to Group, Hide and Show All (to make using the Categories panel easier). Although I could put a group of categories under one grand Parent category, in my setup I would not want the Parent to be a category at all, so that’s why I’m thinking “Group”. Hiding the Group would hide all categories in that group. Hiding the Parent would not hide the children of the parent. If you want to hide the children, select them to hide them.

If this is fiendishly difficult to do, just the Hide and Show All options would be very helpful. (Article and image categories). Have you a few minutes to whip this together?


BB6 Band My band
Gud One My blog

Offline

#34 2012-08-28 12:47:44

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

Re: Categories choice linked to section choice - backend

Right now I have some other open source things to fix too which have non-stop work for days. I have zero (heh) personal use for this whole plugin (I do this type of configuration in PHP/JS), I pretty much just patched it because you asked.

If I have time and otherwise am extending the categories panel I may look into it. But I will give a fair warning that the interface additions have a high change of breaking in the future updates. These thing would relay on “hacks”, and year later someone might have to patch it again.

The grouping thing isn’t probably possible at all, not without rebuilding the whole category system or at least the visual presentation of the panel somehow.

Last edited by Gocom (2012-08-28 12:57:11)

Offline

#35 2012-08-28 13:06:38

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Re: Categories choice linked to section choice - backend

OK, no problem, I hope you can figure out some hide and show all option when you have time. Thanks again for updating bot_cat_per_section_hide


BB6 Band My band
Gud One My blog

Offline

Board footer

Powered by FluxBB