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

Ryan M.'s avatar
Ryan M.
1,511 posts
17 years ago
Ryan M.'s avatar Ryan M.
You know I wuvya, Ryan. That said - it’s not an all-out rule; it depends on the license. If the top of that pretty file says “GPL” or another such license, then you can modify/redistribute it under those terms. But if it says “Copyright” - then you must respect that, too. Just wanted to clarify; I did check MF’s file before I removed the attachment. =)

Oh, I know, Lisa. There’s pwenty of wuv to go around in these here forums.

I really like the integrity of the modules, plugins, and extensions around here, in part because they’re “policed” to make sure no one’s toes get stepped on.

       
richhayler's avatar
richhayler
53 posts
17 years ago
richhayler's avatar richhayler

If it helps some of you please checkout this post for a possible solution:

http://ellislab.com/forums/viewthread/61954/

       
Ryan M.'s avatar
Ryan M.
1,511 posts
17 years ago
Ryan M.'s avatar Ryan M.
mdesign…got a solution for Category Custom Fields ? 😊

I sure do…avoid anything that has anything to do with categories whenever possible! They’re killing me on this project!

(actually, I don’t Victor.)

Arrgh…back to this build…

       
Ryan Blaind's avatar
Ryan Blaind
168 posts
17 years ago
Ryan Blaind's avatar Ryan Blaind

does anyone know if you have access to segment variables with this plugin? Here is my template code:

<ul class="subnav">
        {exp:subcategories root_node="5" sort_by="custom_order" }<li{if segment_3==category_url_title} class="selected-green"{/if}><a href="http://{path=">{category_name}</a></li>
        {/exp:subcategories}
    </ul>

I already added mdesigns new hooks to be able to use category_url_title.. If this isn’t possible is there a different method to achieve what I am trying to do here without using yet another plugin/extension? Thanks

       
Meirion's avatar
Meirion
127 posts
17 years ago
Meirion's avatar Meirion

I’ve downloaded this plugin from the attachment on the first post of this thread.

It is Beta 1, Last Modification 28nd September 2005

Will someone confirm if this is the most recent version of this plugin please?

       
Meirion's avatar
Meirion
127 posts
17 years ago
Meirion's avatar Meirion

Hi Victor, it turns out there is a slightly newer one, Beta 2 is available in this post: http://ellislab.com/forums/viewthread/27220/#119801

       
Andrew Gunstone's avatar
Andrew Gunstone
101 posts
17 years ago
Andrew Gunstone's avatar Andrew Gunstone

Hi all. Love the plugin, it has saved me heaps of time (damn I love this active community!!). Quick question…

Has anyone gotten “weblog:entries” to work within the plugin? For example I want to do the following:

{exp:subcategories root_node="1" count_entries_from_weblogs="2" sort_by="custom_order"}
    {if "{entries_count}" > 0}
        <h3>{category_name}</h3>
            
        {exp:weblog:entries category="{category_id}" weblog="services" disable="member_data|trackbacks" }
            - {title}
        {/exp:weblog:entries}
        
    {/if}    
{/exp:subcategories}

Any suggestions are very welcome. I am even happy to hack the plugin if necessary, but don’t know the EE API well enough as yet to do this on my own.

Thanks.

EDIT: Sorry I should have said that the {category_name} is being pulled out fine, but I am not getting anything from the “weblog:entries” tag. I looked at the debugging output an it is not converting the {category_id} to an integer (but rather passing out “{category_id}” exactly as I have written it.

       
Ryan M.'s avatar
Ryan M.
1,511 posts
17 years ago
Ryan M.'s avatar Ryan M.

You might try embedding that entries tag. Put your entries tag on a new template (note the new word ‘embed’ I put in there!:

{exp:weblog:entries category="{embed:category_id}" weblog="services" disable="member_data|trackbacks" }
 - {title}
{/exp:weblog:entries}

Then update your first template to embed the new template and pass along the category_id using an embed variable, like this:

{exp:subcategories root_node="1" count_entries_from_weblogs="2" sort_by="custom_order"}
  {if "{entries_count}" > 0}
    <h3>{category_name}</h3>
      {embed="template_group/template_name" category_id="{category_id}"}      
  {/if}    
{/exp:subcategories}

Change “template_group/template_name” to the actual ones you have. Maybe it’s “site/category_entries” or something similar. This is untested, so let us know if that worked!

       
Andrew Gunstone's avatar
Andrew Gunstone
101 posts
17 years ago
Andrew Gunstone's avatar Andrew Gunstone

I worship at the feet of the all mighty mdesign! It worked a treat. I am one very happy dude.

I had tried all sorts of tricky things like adding the category_id to an “assign_variable”, to a PHP variable, etc….but hadn’t thought to try this.

You rock-didaly-ok.

😊

       
Ryan M.'s avatar
Ryan M.
1,511 posts
17 years ago
Ryan M.'s avatar Ryan M.

Awesome. I love it when untested things just…work. Remember: embeds and url segments rock!

       
Andrew Gunstone's avatar
Andrew Gunstone
101 posts
17 years ago
Andrew Gunstone's avatar Andrew Gunstone

Agreed. I have my head around most things now…it is just trying to work out the best way of doing things sometimes. Could it be that EE is almost TOO flexible?? I know that I am going to get tarred and feathered for saying that! ha ha.

       
Karlo Ian's avatar
Karlo Ian
59 posts
17 years ago
Karlo Ian's avatar Karlo Ian

hi.. i’ve downloaded the plugin. how could i get the root_node? thanks. it is possible that i will only show the child category?

       
Andrew Gunstone's avatar
Andrew Gunstone
101 posts
17 years ago
Andrew Gunstone's avatar Andrew Gunstone

Hi Karlo,

What do you mean by “how could I get the root_node”? It really depends on what you are trying to do. For example, you could simply hard code the root_node…

{exp:subcategories root_node="5"}
    {category_name}
{/exp:subcategories}

Where root_node “5” is the parent category id. Obviously change the id to whatever it is you want.

Or if you have a dynamic category page, you could use the category_header tag to get the category id of the page (this is exactly how I am using the subcategories plugin!):

{exp:weblog:category_heading weblog="my_weblog"}

    {exp:subcategories root_node="{category_id}"}
        {category_name}
    {/exp:subcategories}

{/exp:weblog:category_heading}

Does this answer your question?

Cheers.

       
Jim Pannell's avatar
Jim Pannell
187 posts
17 years ago
Jim Pannell's avatar Jim Pannell

Thanks to mdesign I’m now able to pull in the category_url_title. However, I’m one of those people that likes to remove ‘/index.php/’ from my urls and usually do this by the Replace plugin… which won’t work within the subcategories plugin.

Does anyone know how I can remove ‘index.php’ from:

<a href="http://{path={my_template_group}/{category_url_title}}">{category_name}</a>

Thanks in advance

Jim

       
Andrew Gunstone's avatar
Andrew Gunstone
101 posts
17 years ago
Andrew Gunstone's avatar Andrew Gunstone

Hi SixMedia. You can permanently remove the index.php…try using one of these methods:

http://expressionengine.com/wiki/Remove_index.php_From_URLs/

Hope that this helps.

Cheers.

       
First 4 5 6 7 8

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.