Search

A new extension, “Nested Categories” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

Thanks :-) Works fine so far ;-) Just the example code in the nested cats DS is a little bit buggy…

Oh, yup. I forget to update an example. Should be fixed now.

Any chance this can be made to work with 2.0.8? I really like it and want to take it forward in my projects…

Hi, designermonkey

Sorry for delay in answer. I’ve been a bit busy these days.

I’ve checked the extension with 2.0.8.RC3 and it looks like works fine. And it’s curious that all variants of the fetchNavigation() function you’ve mentioned in that thread including original are also ok with RC3. I’m just not sure what option is most correct for use.

I think naming locations rather than numbering them is the right way of doing things. Rather weird that I can only get the last one to work properly now.

For posterities sake, and for new readers of this thread thinking “What they babblin’ on about”, here’s the function I used

    public function fetchNavigation(){
        return array(
            array(
                'name' => __('Categories'),
                'children' => array(
                    array(
                        'name' => __('List View'),
                        'link' => '/list/'
                    ),
                    array(
                        'name' => __('Tree View'),
                        'link' => '/tree/'
                    ),
                )
            )
        );
    }

Also, like I said in the other thread, I hope the core guys (or even some hard core devs) can get some dev docs up soon for this kind of thing.

Thanks for responding dude!

PS, I love this extension. I’m very sad when it comes to organising categories!

I think I may have narrowed the problem down… There’s a trailling comma after the second child array. Removing it and using your existing function (or any other method for that matter) instantly solves any problem I’ve been seeing…

Is there any plan to update this extension to use handles at all? I really want to keep using it, but I really also want to be able to use category handles in my urls, which I can’t do at present.

I’ve seen there are handle columns in the db tables, and some commented out php code for handles?

Ok, so I’ve been cheeky and updated the extension to save and output handles correctly (attached).

I still have no idea how to get it to recognize handles instead of IDs in URLs. If anyone can help, I’d appreciate it very much…

Attachments:
nestedcats.zip

@designermonkey, I have in plans to update the extension in a day or two. Your request (filtering by handle) is present in a TODO list. Please, wait a little :)

ps: I’m really glad to see someone use this extension. Thanks for your interest and patience

No problem waiting! It’s a really useful feature to have!

I think I’ve updated it ok so far, please use anything you think is right, although I’m a bit of a newbie to PHP…

Nested Categories updated to version 2.0.1 beta on 7th of June 2010

  • Added handles (are always unique) and filtering by handle
  • Fixed incorrect output of prepareTableValue() when “allow multiple” is enabled
  • Fixed error when grouping XML output by Category with “allow multiple” is enabled
  • Added localization strings
  • Added russian localization

Hey hey Andrrr, that was quick!

Thanks very much for this update, I no longer have to worry about my archives now :)

You’re going to get sick of me soon,

I’ve set up an url structure for archives which has page params of parent/child so that I could use one datasource to filter the categories field in my section.

In the datasource I’ve put the following in my filter box

{$parent}+{$child}

What I was expecting was that it would filter by $parent first and then by $child if it existed. So that $parent and $child we’re required in the entry for it to be in the results.

It doesn’t do this though, the parent filters fine and the child filters fine, but not together, one and the other.

Is there any way to get it to filter both together?

Here are two parts of a problem.

First. The Extension is not yet supports AND and OR operations in a queries. So, this {$parent}+{$child} wouldn’t work.

Second. I believe, It’s just not necessary to specify parent and child together in filter, because all Categories are unique by it’s IDs and handles. Branches of a categories tree can’t intersect one with another. Ie this: fruits+meat could make sense in a filter, but not this: fruits+apples.

Maybe, in your case filter could look like this {$child:$parent}. It means: if $child is defined - show entries from a $child branch. If not - show entries from a $parent branch (including all children).

Hope, I understood your problem right :)

Yeah, that’s a good answer…

I re-thought it and realised that just one category url-param should be sufficient anyway, been trying to overcomplicate it a little when there is no need.

Thanks for an excellent extension, it was one thing I really missed when moving from Wordpress.

Andrr thanks for this extension, it seems to be exactly what I need.

I need (max) the following structure:

$root/parent-cat/child-cat/grand-child-cat/$entry-handle

Currently, I have the nested categories set up and have a /parent-cat/ page (this should filter sub-entries with ‘parent-cat’ category).

As I’m new to Symphony I am struggling to figure out how to get the filtering/URL routing right. I attached the DS to the page so I am able to get a tree of categories, but I need filtering. This should be done, I believe, through page-params but could you point me in the right direction? Thx.

Edit: Nevermind, I think I figured it out (partly). I needed to create a URL Params category/category indeed etc.

If I remember right, I asked about the parent-cat/child-cat/grandchild-cat thing a while back and was told that I wouldn’t be able to filter through the categories like that… Let me dig out the thread…

I was right, Comment 16 is the answer (in this thread)…

I thought it was a different thread…

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details