Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2011-02-19 18:20:50

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: smd_parent: grab parents up the tree from any category

Shame on you for providing tardy (and FREE) support for your wonderful (and FREE) plugin :).
Your fix seems to work perfectly. I didn’t do any extensive testing either, but it works in my case.
I guess it was a question of me misunderstanding the “level” variable, but I do think the change is a welcome one in any case.

Thank you so much! :)


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#22 2011-03-23 16:15:03

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 981
Website

Re: smd_parent: grab parents up the tree from any category

Is there any way to test the parent for multiple values? I currently have something like this:

<txp:variable name="parent_topic"><txp:smd_parent/></txp:variable>
[...]
<txp:if_variable name="parent_topic" value="x">Do this.</txp:if_variable>

I want to “Do this” if the parent category is X, Y, or Z, which I could enter as a comma-separated list. But if I’m not mistaken, if_variable can’t test for multiple values as of TXP 4.3.0.

Offline

#23 2011-03-23 16:17:50

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

Re: smd_parent: grab parents up the tree from any category

johnstephens wrote:

Is there any way to test the parent for multiple values?

Not natively. smd_if’s in operator is probably your best bet. smd_multi_select is overkill.


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

#24 2011-03-23 16:21:11

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 981
Website

Re: smd_parent: grab parents up the tree from any category

Thanks, Stef! I suspected smd_if might be the only way, but I thought I could get away with not installing another plugin. I’ll do it!

Offline

#25 2018-10-05 14:41:44

hildebruns
Member
Registered: 2009-03-10
Posts: 23

Re: smd_parent: grab parents up the tree from any category

Hello, is there a version for 4.7.1? I have the plugin installed and unfortunately it does not work.

Offline

#26 2018-10-05 15:08:08

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

Re: smd_parent: grab parents up the tree from any category

Interesting. When you say “doesn’t work”, how are you using the tag and what do you expect? There should be nothing in the (very small) plugin that breaks under 4.7.x but there have been many changes to the parser and tags. Something may have affected my kludgy attempt at handling parents.

Depending on what you are trying to do, you may not even need the plugin any more as there have been tag improvements that might help out. So when we find out what it is you are trying to achieve with the plugin, someone may be able to help you find a native solution.


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

#27 2018-10-05 15:54:03

etc
Developer
Registered: 2010-11-11
Posts: 2,946
Website

Re: smd_parent: grab parents up the tree from any category

In 4.7 <txp:breadcrumb /> can extract (grand-)parents from the category tree via limit and offset attributes:

<txp:breadcrumb category="your_category" limit="1" offset="-1"
    section="" label="" wraptag="" />

Also

<txp:if_category category="your_category" parent="1" name="cat1, cat2, cat3" />

will test if your_category is a child of cat1, cat2, cat3.


etc_[ query | search | pagination | date | tree | cache ]

Offline

Board footer

Powered by FluxBB