We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New "Subcategories" plugin available.

Development and Programming

Adam Khan's avatar
Adam Khan
315 posts
19 years ago
Adam Khan's avatar Adam Khan
Feature Request: Works with Category Names On. :cheese:

It’s a bit of a workaround, but you can do this using snippets: Pass the category_id to a template containing the subcategories plugin and place it in the plugin’s root_node parameter. For example:

Main template:

{exp:snippets template="template-group/subcategories-template"}
{thiscat}{exp:weblog:category_heading weblog="weblog1"}{category_id}{/exp:weblog:category_heading}{/thiscat}
{/exp:snippets}

subcategories-template template:

<h3>
{exp:subcategories root_node="%thiscat%"}
<a href="http://{path=something}{category_name}">{category_name}</a>, 
{/exp:subcategories}
</h3>
       
xmaker's avatar
xmaker
6 posts
19 years ago
xmaker's avatar xmaker

Hello, please tell me how to install beta2 in EE latest version…

       
groovc's avatar
groovc
13 posts
18 years ago
groovc's avatar groovc

Can this plug-in be nested within itself?

For instance, can you do this?

{exp:subcategories root_node="14" sort_by="category_id"}
        <a href="http://{path=weblog/index}">{category_name}</a> - category id is {category_id}
        
        {exp:subcategories root_node="{category_id}"}
        the category_id passed is {category_id}

        <a href="http://{path=weblog/index}">{category_name}</a>

        {/exp:subcategories}   
                     
{/exp:subcategories}

The first level works and spits out what I want. And I can see that it has the correct ID being passed to the nested version; however, it stops working at this point. Any ideas?

       
designgroup's avatar
designgroup
2 posts
18 years ago
designgroup's avatar designgroup

Hi, this is an awesome plugin! I spent ages trying to figure out a way to do exactly this. I don’t know why it’s not already an official included plugin? I have one question though. Is it possible to show child categories, if they exist, beneath the “root_node”?

for example, categories are set as below:

Fruit (#1) - Apple (#2) – Russett (#5) – Cox (#6) - Orange (#3) - Banana (#4)

setting {root_node} as “1” will currently show:

Apple Orange Banana

but is it possible to show:

Apple - Russett - Cox Orange Banana

??

       
solarsail's avatar
solarsail
29 posts
18 years ago
solarsail's avatar solarsail

Unless I am doing something wrong, the subcategories plugin can’t display the category_description. Am I correct?

I am looking for a way to simply display:

Subcategory1ofTheCurrentlyViewedCategory Category description of subcategory1

Subcategory2ofTheCurrentlyViewedCategory Category description of subcategory2

etc.

I can’t do this with the dyno_cat plugin because, even though it does show category_descriptions, it won’t limit itself to only subcategories in the currently viewed category.

The subcategories plugin can limit itself but won’t apparently display descriptions.

       
Mr. Wilson's avatar
Mr. Wilson
131 posts
18 years ago
Mr. Wilson's avatar Mr. Wilson

What variable are you using? I just took a peek in the code, and it looks like the plugin should replace {cat_description} with the category description.

       
solarsail's avatar
solarsail
29 posts
18 years ago
solarsail's avatar solarsail
What variable are you using? I just took a peek in the code, and it looks like the plugin should replace {cat_description} with the category description.

Neither cat_description nor category_description appear to work.

Here is my code:

{exp:subcategories}
<a href="http://{path=weblogname/templatename}C{category_id}">{category_name}</a>

{category_description}
{/exp:subcategories}

This outputs:

Subcategory {category_description}

Subcategory {category_description}

etc. That is, the description tag is not being processed.

Thank you, solar

       
Flapjack's avatar
Flapjack
1 posts
18 years ago
Flapjack's avatar Flapjack

Hi everyone, I have a question regarding this plugin, and actually EE in general.

Would someone be willing to offer up some custom code, if this isn’t that hard to achieve? I’m pretty certain that EE doesn’t offer this right out of the box.

Ok, so I’ve got a Restaurants page that displays all the different subcategories of restaurants (Mexican Food, Chinese Food). Instead of one big long list, I’d like to have three lists/columns.

Here is the logic that would need to take place.

Count the total number of subcategories. Divide that number by 3. Then loop through and create a list 3 separate times. For example, lets say there are 30 subcategories. I would need it to repeat the following code three times, looping through 10 times each, each one picking up where the other left off. The first would display 1-10, then 11-20, then 21-30.

<ul>
{exp:subcategories root_node="9" count_entries_from_weblogs="4"}
<li><a href="http://zipeye.com/business/listing/{category_name}">{category_name} - <span>{entries_count}</span></a></li>
{/exp:subcategories}
</ul>

Is this possible? Has anyone ever ran into this problem before? It seems like a lot of headache just to achieve a “column” effect, but the client really wants it.

       
Joelle's avatar
Joelle
272 posts
18 years ago
Joelle's avatar Joelle

Has anyone used this plug-in recently? I’ve been trying to get it to work for hours now and I can’t seem to get it to give me anything but a MySQL Error. Does it work with the latest version of EE?

I really need to just display the child categories, without having to use the whole show=”not 10” malarkey. That poses future problems. I can’t for the life of me figure out why we can show ‘parent only’ but not have the option to do ‘child only’.

Anyway, I’m not quite sure how to put together a query to do what I want and I was hoping this plug-in was the ticket. Anyone have any recent luck with it? Maybe I’m just missing something…

Thaaaaaank you. 😊

       
PDM's avatar
PDM
61 posts
18 years ago
PDM's avatar PDM

Joelle, Did you ever figure this out re how to display just child categories of parent X? I’m in the same boat and don’t want to hard code which children to show, since the client will be adding more over time. I got things to list correctly using a query, but then when you click on the link of the subchild to view its entries, it loses the category_id, since used cat_id for the query. So close, but yet so far!

Thanks,

Paula

       
Joelle's avatar
Joelle
272 posts
18 years ago
Joelle's avatar Joelle

Hi Paula,

Actually, I didn’t. I went ahead and made separate category groups and assigned them all to the same blog. The I just filtered by category group instead. Does that help? 😊

       
PDM's avatar
PDM
61 posts
18 years ago
PDM's avatar PDM

Yes, it’s helpful hearing what finally worked. I’d thought about just using a category group instead, and wondered if there any limitations to that approach? I’m trying to get the lay of the land…like if you go to display categories that are assigned to multiple blogs, don’t you only get the entries related to that category for the one particular blog you’re in? (i.e., the categories are a handy naming convention to tag content, but not necessarily retrieve ALL content from multiple blogs with that tag?)

If so, seems chunking them into so many groups wouldn’t really affect their availability in different blogs…if you needed ALL the categories in their unchunked glory, you’d just (EDIT:) assign multiple groups to the blog.

Thanks for the quick response! It’s helpful when it arrives when you’re still freshly mired in the problem.

Paula

       
PDM's avatar
PDM
61 posts
18 years ago
PDM's avatar PDM

Joelle,

So I tried the new category group approach and it’s working really well. Helped things fall into place quite nicely, and solved another problem too. Thanks for the suggestion.

Paula

       
joelene's avatar
joelene
87 posts
17 years ago
joelene's avatar joelene

Joelle,

when you say you got it working using category groups do you mean that you abandoned the subcategories plugin and reworked it using the categiry groups (in which case how doyou get the category group name variable?) or do you mean that you used the subcategories plugin to extract the category group names?

       
Mikee Bee's avatar
Mikee Bee
179 posts
17 years ago
Mikee Bee's avatar Mikee Bee

Is it possible to use some form of

show_empty="no"

for the subcategories tag? Its a wee problem when the subcategories are shown regardless whether they have any entries or not

       
First 2 3 4 5 6 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.