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

Plugin: Category Id

Development and Programming

Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas

Hi nateiler,

If you need to save some db calls, you can use Category Id plugin together with Category Info plugin. It would be more efficient than to use Category Id together with Child Categories.

       
NKT com's avatar
NKT com
124 posts
15 years ago
NKT com's avatar NKT com

This might be the wrong place to ask but I’d like to generate a menu like this that display regardless of the url….

Category title Entry 1 Entry 2 Entry 3 Category title 2 Entry 4 Entry 5 Entry 6

I basically need a plugin that loops through categories in a set group and output their category id. I thought this plugin could do something like this but it appears it can’t.

{exp:category_id category_group="12" parse="inward"}
  {exp:weblog:entries weblog="{segment_1}" category="{category_id}" limit="999" disable="member_data|pagination|trackbacks" dynamic="off"}
  {if count =="1"}{categories show_group="12"}<li class="cat">{category_name}</li>{/categories}{/if}
    <li{if "{url_title}"=="{segment_2}"} class="current"{/if}><a href="http://{url_title_path={segment_1}}">{title}</a></li>
  {/exp:weblog:entries}
{/exp:category_id}
       
Laisvunas's avatar
Laisvunas
879 posts
15 years ago
Laisvunas's avatar Laisvunas

Hi,

Have you tries Child Categories plugin?

       
Laisvunas's avatar
Laisvunas
879 posts
15 years ago
Laisvunas's avatar Laisvunas

Hi all,

Matt Stein updated Category Id plugin to be compatible with EE2.0.

You will find updated version in the first post of this thread.

       
fanderson's avatar
fanderson
883 posts
15 years ago
fanderson's avatar fanderson

Hi Laisvunas,

I am working with the Category ID module and need to add a conditional. Currently I am using it to highlight the Category name on dynamic pages as follows:

{exp:category_id category_group="2" category_url_title="{segment_3}" parse="inward"}
  {exp:weblog:entries weblog="intro-text" category="{category_id}" site="1" limit="1"}
    {categories show="{category_id}"}
    <h2>{category_name}</h2>
    {/categories}
  {/exp:weblog:entries}
{/exp:category_id}

I then have a generic catch all entry from a weblog as follows:

{exp:weblog:entries weblog="intro-text" limit="1" disable="trackbacks|member_data|pagination"}
  {intro-text}
{/exp:weblog:entries}

I need to be able to have category-specific entries for each sub category that is displayed instead of the generic entry when there is one. So I need to be able to do something like this:

if there is an intro-text entry for this sub-category show it, otherwise, show the generic intro-text entry.

I just need a little help to integrate this into the category_id plugin syntax.

Thanks.

       
fanderson's avatar
fanderson
883 posts
15 years ago
fanderson's avatar fanderson

Hi Laisvunas,

Cancel that request. I just figured it out:

{if intro-text !=""}
 {exp:category_id category_group="2" category_url_title="{segment_3}" parse="inward"}
  {exp:weblog:entries weblog="intro-text" limit="1" category="{category_id}" disable="trackbacks|pagination|member_data" parse="inward"}
    {intro-text}
  {/exp:weblog:entries}
{/exp:category_id}        

{if:else}

{exp:weblog:entries weblog="intro-text" limit="1" disable="trackbacks|member_data|pagination"}
  {intro-text}
{/exp:weblog:entries}
{/if}

Thanks.

       
fanderson's avatar
fanderson
883 posts
15 years ago
fanderson's avatar fanderson

This segment of code was working perfectly to show the name of the sub-category at the top of the page content area, but now it is broken and does not show here.

{exp:category_id category_group="2" category_url_title="{segment_3}" parse="inward"}
  {exp:weblog:entries weblog="intro-text" category="{category_id}" site="1" limit="1"}
    {categories show="{category_id}"}
    <h2>{category_name}</h2>
    {/categories}
  {/exp:weblog:entries}
{/exp:category_id}

I would really appreciate some help to understand why and how to get it to show again.

Thank you!

Forrest

       
Laisvunas's avatar
Laisvunas
879 posts
15 years ago
Laisvunas's avatar Laisvunas

Hi,

I released version 1.6 of Category Id plugin.

New features:

1) it’s now possible to use category group names as values of “category_group” parameter;

2) pipe character can now be used inside the value of this parameter to specify several category groups. In case you use pipe character, make sure category url titles are unique.

       
1 2 3

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.