2 of 2
2
Plugin:  Entry Categories
Posted: 02 September 2009 08:50 PM   [ Ignore ]   [ # 19 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  349
Joined  02-06-2009

Hmm, whatever was funky seems to have righted itself - some sort of caching issues, maybe.

Although, I’ll be trying the good-old fashioned {categories} tag instead - I need the looping ability, I think.

Thx!

 Signature 

TucsonSentinel.com - we’re watching Tucson

Profile
 
 
Posted: 16 October 2009 02:00 PM   [ Ignore ]   [ # 20 ]  
Grad Student
Rank
Total Posts:  61
Joined  07-20-2007

Hi, this plugin just saved my ass.

I have a question: How can I output more than 1 child category?

Let’s say under the Category “California” I selected two child cateogries “Los Angeles” and “San Diego”.

Can I do this?

Thanks for your work!

G.

Profile
 
 
Posted: 17 October 2009 03:46 AM   [ Ignore ]   [ # 21 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1156
Joined  02-02-2007

How can I output more than 1 child category?

Write the code as this:

{level1_category0_cat_name}{level1_category1_cat_name}{level1_category2_cat_name} ... 
 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 02 November 2009 06:00 AM   [ Ignore ]   [ # 22 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  192
Joined  06-20-2008

It would be great if you could add in the “backspace” function to this plugin - when you’re getting a list of categories, they usually have something like a comma after each, which I need to remove after the last one…

 Signature 

“Dude,I totally Swayze’d that mother.”
Project 14

Profile
 
 
Posted: 03 November 2009 08:40 AM   [ Ignore ]   [ # 23 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1156
Joined  02-02-2007

Hi Luc,

This plugin does not loop through tagdata, so, there is no need for “backspace” parameter.

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 11 November 2009 09:44 PM   [ Ignore ]   [ # 24 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  838
Joined  02-25-2008

Hi Laisvunas,

I would like to display the category_name of the current entry where the category is a subcategory and shows up in segment 3.

Is this possible with this plugin? If so how?

Thanks.

 Signature 

Rouviere Media — I Build Expression Engine Sites. sans-borders.

Profile
 
 
Posted: 12 November 2009 05:43 AM   [ Ignore ]   [ # 25 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1156
Joined  02-02-2007

Hi Forrest,

Use Entry Categories plugin

{exp:entry_cats entry_id="30" site="1"}

{level1_category0_cat_name}


{
/exp:entry_cats} 

or Category Id plugin together with either exp:weblog:entries tag

{exp:category_id category_group="2" category_url_title="{segment_3}" parse="inward"}
{exp
:weblog:entries entry_id="30" site="1"}

{categories show
="{category_id}"}

{category_name}

{
/categories}


{
/exp:weblog:entries} 
{
/exp:category_id} 
 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 12 November 2009 06:25 AM   [ Ignore ]   [ # 26 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  838
Joined  02-25-2008

Hi Laisvunas,

It looks like the second option is the best one. My only concern is that this appears to require manual entry of the entry_id? Is it possible to capture this dynamically?

Thanks for you help,

Forrest

 Signature 

Rouviere Media — I Build Expression Engine Sites. sans-borders.

Profile
 
 
Posted: 12 November 2009 09:03 AM   [ Ignore ]   [ # 27 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1156
Joined  02-02-2007

It does not require entry_id - you can display category name without it:

{exp:category_id category_group="2" category_url_title="{segment_3}" parse="inward"}
{exp
:weblog:entries weblog="my_weblog" category="{category_id}" site="1" limit="1"}

{categories show
="{category_id}"}

{category_name}

{
/categories}


{
/exp:weblog:entries}
{
/exp:category_id} 
 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 12 November 2009 09:12 AM   [ Ignore ]   [ # 28 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  838
Joined  02-25-2008

Ah! Brilliant. Problem solved. I am set now. Thank you again for your excellent help.

Best regards, Forrest.

 Signature 

Rouviere Media — I Build Expression Engine Sites. sans-borders.

Profile
 
 
Posted: 13 November 2009 10:05 PM   [ Ignore ]   [ # 29 ]  
Grad Student
Avatar
Rank
Total Posts:  47
Joined  06-14-2008

Hi Laisvunas.

I am using your plugin to dynamically generate a sidebar menu that only displays the categories for the section an entry belongs to.

For example: On a site with the following main categories/sections:

- Home
- About US
- Events
- Programs
- News
- Resources


1) If the entry is for the About Us category, the sidebar menu will look like this:

- About US
- Services
- Officers
- Committees

2) If the entry is for the Services or Service One category, the sidebar menu will look like this:

- About US
- Services
- - Service One
- - Service Two
- - Service Three
- Officers
- Committees

The code:

{assign_variable:my_weblog="pages"}

{exp
:weblog:entries weblog="{my_weblog}" limit="1" disable="member_data|pagination|trackbacks"}
{exp
:entry_cats entry_id="{entry_id}" parse="inward"}

<ul>

{exp:weblog:categories weblog="{my_weblog}" style="linear"}

{if {level0_category0_cat_id} 
== {category_id} OR {level0_category0_cat_id} == {parent_id} }
  
<li><a href="/index.php/{catpage_template}/c/{category_url_title}/">{category_name}</a>
    
{if "{level1_category0_cat_id}" == "{category_id}" }
       {embed
="{global_tpl}/_sideMenu_level2" entry_id="{entry_id}" my_weblog="{my_weblog}"}
    {
/if}
  
</li>
{/if}

{
/exp:weblog:categories}

</ul>

{/exp:entry_cats}
{
/exp:weblog:entries} 


This code achieves what I want. But when the entry is for a category-level 1, it will display the following error:

NoticeUndefined index1 in E:\pesawebee\Hid8uL2system\plugins\pi.entry_cats.php on line 386 

The {if “{level1_category0_cat_id}” == “{category_id}”} is the cause of that error.

(Before you ask: no, the embed is not the issue. In fact, you could eliminate that if statement alltogether and just keep the {level1_category0_cat_id} for testing purpose. The error will still be generated.)

Not sure if this is a bug in your excellent plugin or if it is me approaching it the wrong way.

Looking forward to your advice.

/ Michel

Plugin: pi.entry_cats_v1.2.2.zip
ExpressionEngine 1.6.8
Server: Windows NT
PHP: Version 5.2.9-2

 Signature 

Michel Godts eDesign | Website design, consulting, and solutions, Rochester, NY

Profile
 
 
Posted: 10 December 2009 10:10 AM   [ Ignore ]   [ # 30 ]  
Grad Student
Rank
Total Posts:  93
Joined  07-27-2009

any idea why this isnt working?

{exp:weblog:entries weblog="directory" dynamic="on" limit="1"}
  {exp
:entry_cats entry_id="{entry_id}" invalid_input="alert"}

    Entry ID
{entry_id}<br/>                <!-- this works -->
    
Level0 ID{level0_category0_cat_id}     <!-- this works -->
    
Level1 ID{level1_category0_cat_id}     <!-- this works -->


<!-- 
now i want to pass Level0 ID in to the child_categories extension: -->

{exp:child_categories parent="{level0_category0_cat_id}" weblog="directory"}
  {parent_category_start}
  
<class="directory" href="{homepage}/category/{parent_category_url_title}/">{parent_category_name}</a>
  <
ul id="directory">
    
{parent_category_end}
    {child_category_start}
    
<li><a href="{homepage}/listings/category/{child_category_url_title}/">{child_category_name}   ({entries_total})</a></li>
    
{child_category_end}
    {
/exp:child_categories} 
    
</ul>

<!-- as 
a testi output the value again after the child_categories call -->

    
Entry ID{entry_id}<br/>                <!-- this works -->
    
Level0 ID{level0_category0_cat_id}     <!-- this works -->
    
Level1 ID{level1_category0_cat_id}     <!-- this works -->

{/exp:entry_cats}

{
/exp:weblog:entries} 

nothing happens. the child_categories call gets ignored, but i have this working on other pages (when entry_cats isn’t being used.

thanks.

Profile
 
 
Posted: 10 December 2009 11:38 AM   [ Ignore ]   [ # 31 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1156
Joined  02-02-2007

Hi Ross,

It seems that you shoud add

parse="inward" 

parameter to exp:entry_cats tag.

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 10 December 2009 01:02 PM   [ Ignore ]   [ # 32 ]  
Grad Student
Rank
Total Posts:  93
Joined  07-27-2009

you’re a genius, works perfectly

thanks for a great set of plugins!

Profile
 
 
Posted: 15 April 2010 10:09 AM   [ Ignore ]   [ # 33 ]  
Summer Student
Avatar
Total Posts:  23
Joined  02-08-2010

Too bad this doesn’t seem to work yet with EE 2.

Profile
 
 
Posted: 07 May 2010 07:19 AM   [ Ignore ]   [ # 34 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  4003
Joined  05-13-2004

this is brilliant - any chance add backspace=”” to the parameters?

 Signature 

web: Caffeine Creations twitter @CS_sean

Profile
 
 
Posted: 14 May 2010 09:19 AM   [ Ignore ]   [ # 35 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1156
Joined  02-02-2007

Hi,

I released version 1.3 of Entry Categories plugin.

In this version a new optional parameter was added - show_group. It allows you to specify category group id number.
You can stack group id numbers using pipe character show=“1|6|9”. Or use “not”
(with a space after it) to exclude categories, e.g. show_group=“not 5|7|11”.

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 15 June 2010 07:49 AM   [ Ignore ]   [ # 36 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1156
Joined  02-02-2007

Hi,

I released version 1.4 of Entry Categories plugin.

New feature: it’s now possible to use category group names as values of “show_group” parameter.

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
   
2 of 2
2