ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

is there a plugin that will detect the category and subcategory from my url?

March 27, 2012 9:33pm

Subscribe [2]
  • #1 / Mar 27, 2012 9:33pm

    robbiegod

    43 posts

    For example, let’s say i have url like this one:

    /template_group/template_name/parent_category/subcategory/other-parent-category/subcategory/

    The reason why i have a other-parent-category is because i have 2 template groups and i am merging the url together. I have this part working but i have to use the segment_# to get the current category.

    So i have these long urls and i am relying heavily on segment_# variables which i would like to have something more exact.  I know the minute i make my website like segment_1 is going to change.

    What i am wondering is if there is plugin that will scan the current url and see if there is something in the url that is a category.

  • #2 / Mar 28, 2012 3:53am

    Laisvunas

    879 posts

    Hi,

    Use this add-on: Category Id plugin.

  • #3 / Mar 28, 2012 1:48pm

    robbiegod

    43 posts

    that is a cool plugin, but not exactly what i am looking for. I’m looking for something that will analyze the url and detect any category names inside the url and then let me grab the category_id, category_name, category_shortname—then i can use this information to pass it to the weblog.

    Can you think of a way to do that?

    Thanks for your feedback, i’ll look at your plugin closer, but i think because it need the chanell name and url—i wont have that available to me.

    I’ll experiement when i get home, maybe it will work.

  • #4 / Mar 28, 2012 1:59pm

    Laisvunas

    879 posts

    Hi,

    You can output category_id, category_name, category_shortname and more by using Category Info plugin. Category Info plugin is compatible with Category Id plugin. You would only need to wrap exp:cat_info tag with exp:category_id tag and set parsing to be done “inward”.

  • #5 / Mar 28, 2012 5:52pm

    Dan Decker

    7338 posts

    Hi ijwebsites,

    Let’s see if we can get you some options for this!

    You should look at Seg2Cat, particularly the {segment_category_ids} tags. It returns the category ids of any categories found in the URL, regardless of there place in the segment array.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases