21 of 21
21
Plugin: Child Categories
Posted: 17 June 2010 08:28 PM   [ Ignore ]   [ # 361 ]  
Summer Student
Avatar
Total Posts:  19
Joined  03-14-2008

Hi,

is it possible to output a custom category fields?

I tried to use {exp:weblog:categories show=”{child_category_id}”} but it does not work for me:

{exp:child_categories category_group="4" weblog="{segment_1}" show_empty="no"}
    {parent_category_start}
        
<optgroup label="{parent_category_name}">
    
{parent_category_end}
        {child_category_start}
            
<option value="{child_category_url_title}">
                
{exp:weblog:categories category_group="4" show="{child_category_id}" weblog="{segment_1}" style="linear"}
                    {custom_category_field}
                {
/exp:weblog:categories}
            
</option>
        
{child_category_end}
    {parent_wrapper_bottom_start}
        
</optgroup>
    
{parent_wrapper_bottom_end}
{
/exp:child_categories} 

Any ideas?

 Signature 

My ExpressionEngine Bookmarks | Twitter @freshmango

Profile
 
 
Posted: 17 June 2010 08:51 PM   [ Ignore ]   [ # 362 ]  
Summer Student
Avatar
Total Posts:  19
Joined  03-14-2008

So this seems to work:

{child_category_start}
    
<option value="{child_category_url_title}">
        
{exp:weblog:categories category_group="4" weblog="{segment_1}" show="{parent_category_id}|{child_category_id}" show_empty="yes" style="linear"}
            {if category_id 
!= "{parent_category_id}"}
                {custom_category_field}
            {
/if}
        {
/exp:weblog:categories}
    
</option>
{child_category_end} 

I had to include the parent category id in the show attribute and then filter it out again:

{if category_id != "{parent_category_id}"

.

Not very elegant but it works.

 Signature 

My ExpressionEngine Bookmarks | Twitter @freshmango

Profile
 
 
Posted: 23 June 2010 05:09 PM   [ Ignore ]   [ # 363 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  838
Joined  02-25-2008

I have a section on a website that uses categories for organizing articles. I use the categories as navigation for this site and will be using this navigation to link to a page that displays that Parent Category Title and all associated entries as well as all child categories of that parent and their associated entries.

I would like the end result to look like this:

<h2>Category Title</h2>
    <
p><a href="#">Entry Title</a></p>
    <
p><a href="#">Entry Title</a></p>
    <
p><a href="#">Entry Title</a></p>
    <
p><a href="#">Entry Title</a></p>    

<
h3>Sub-cateogry 1 Title</h3>
    <
p><a href="#">Entry Title</a></p>
    <
p><a href="#">Entry Title</a></p>
    <
p><a href="#">Entry Title</a></p>
    <
p><a href="#">Entry Title</a></p>
    <
p><a href="#">Entry Title</a></p>
    
<
h3>Sub-cateogry 2 Title</h3>
    <
p><a href="#">Entry Title</a></p>
    <
p><a href="#">Entry Title</a></p>
    <
p><a href="#">Entry Title</a></p>
    <
p><a href="#">Entry Title</a></p>
    <
p><a href="#">Entry Title</a></p>    
    
<
h3>Sub-cateogry 4 Title</h3>
    <
p><a href="#">Entry Title</a></p>
    <
p><a href="#">Entry Title</a></p>
    <
p><a href="#">Entry Title</a></p>
    <
p><a href="#">Entry Title</a></p>
    <
p><a href="#">Entry Title</a></p

I tried using this code, but it only displayed the category titles:

{exp:weblog:categories category_group="2"  weblog="articles"}
{exp
:child_categories parent="{category_id}" child_categories_sort_by="custom" child_categories_sort_direction="asc" show_empty="yes" entries_sort_by="date" entries_sort_direction="asc" entries_limit="5" site="1"}
        
{parent_category_start}
  
<a href="{site_url}topic/{parent_category_id}">{parent_category_name}</a><br>
{parent_category_end}

{entries_start}
    
<a href="{site_url}topic/{parent_category_id}/{url_title}/">{title}</a><br>
{entries_end}
        
{child_category_start}
  
<a href="{site_url}topic/{child_category_id}">{child_category_name}</a><br>
{child_category_end}
        
{entries_start}
    
<a href="{site_url}topic/{child_category_id}/{url_title}/">{title}</a><br>
{entries_end}

 {
/exp:child_categories}
{
/exp:weblog:categories} 

I am obviously missing something here and would appreciate some help. Thanks.

 Signature 

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

Profile
 
 
Posted: 25 June 2010 12:33 PM   [ Ignore ]   [ # 364 ]  
Grad Student
Avatar
Rank
Total Posts:  46
Joined  04-29-2009

Hello. I am having a problem that I think this plugin and the category_id plugin together should be able to fix, but I am not sure why it isn’t working. Here is the code:

{exp:weblog:entries weblog="sr_province" url_title="{segment_1}" dynamic="off"}
                    
<img src="{sr_map}" alt="map" />
                    <
h1>Snowmobiling in {title}</h1>
                    <
p>{sr_intro}</p>
                
{/exp:weblog:entries}
                
<ul id="articlelinks">
                    
{exp:category_id category_group="14" category_url_title="{segment_1}" parse="inward"}
                        {exp
:weblog:entries weblog="sr_region" category="{category_id}" orderby="sr_entry_order" sort="asc" dynamic="off"}
                            
<li>
                                <
img src="{sr_summary_map}" alt="map" />
                                <
h3><a href="/{segment_1}/{url_title}/">{title}</a></h3>
                                <
p>{sr_summary}</p>
                                <
h4>Snowmobile locations</h4>
                                <
ul>
                                    
{exp:category_id category_group="14" category_url_title="{url_title}" parse="inward"}
******                                 {exp:child_categories parent="{category_id}" parse="inward"}
                                            {child_category_start}
                                                
<li>
                                                    <
a href="/{segment_1}/{url_title}/{child_category_url_title}/">
                                                        
{child_category_name}
                                                    
</a>
                                                </
li>
                                            
{child_category_end}
                                        {
/exp:child_categories}
                                    {
/exp:category_id}
                                
</ul>
                            </
li>
                        
{/exp:weblog:entries}
                    {
/exp:category_id} 

Basically I need show content based on three levels on categories. Since it is destinations I have categories for canada and usa and then within canada I have province and within that regions and then within that I have cities. So for British Columbia page I need to show entry content for an entry called British Columbia. Then I need to list all regions tagged with the category British Columbia. and with the list of regions I need to list all cities that have been tagged as children of the region category.

It’s pretty much all working except for the one category_id tag, on the line I added the ****** to, is not showing the category_id of the region. If I type in a specific category_id it works, so I am assuming it is not getting the category_id using the category_id plugin, but I am not sure why.

Can anyone tell me if some of my code is a bit wrong? Or maybe I am going about this way wrong.

Profile
 
 
Posted: 26 June 2010 01:05 PM   [ Ignore ]   [ # 365 ]  
Lab Assistant
RankRank
Total Posts:  244
Joined  11-02-2006

Hi Laisvunas,

I love this plugin and, like one or two others who have asked, I wonder if you have any plans to make it EE2 compatible, especially now the end of beta is officially ‘near’?

I would pay to help its development. Any other takers?

Profile
 
 
Posted: 30 June 2010 08:34 AM   [ Ignore ]   [ # 366 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  838
Joined  02-25-2008

Hi Laisvunas,

I figured it out. I was able to achieve my desired results as follows:

{exp:category_id category_group="2" category_url_title="{segment_2}" parse="inward"}    
            {exp
:child_categories parent="{category_id}" child_categories_sort_by="custom" child_categories_sort_direction="asc" show_empty="yes" entries_sort_by="date" entries_sort_direction="asc" entries_limit="3" site="1"}
                {parent_category_start}
                
<h1><a href="{homepage}/category/{parent_category_url_title}/">{parent_category_name}</a></h1>
                
{parent_category_end}
                {child_category_start}
                
<h2><a href="{homepage}/category/{child_category_url_title}/">{child_category_name}</a></h2>
                
Total entries{entries_total}<br>
                
{child_category_end}
                {entries_wrapper_top_start}
<ul>{entries_wrapper_top_end}
                {entries_start}
                
<li><a href="{weblog_url}{url_title}/">{title}</aWeblog{weblog_name}posted{entry_date}</li>
                
{entries_end}
                {entries_wrapper_bottom_start}
</ul>{entries_wrapper_bottom_end}
            {
/exp:child_categories} 
        {
/exp:category_id} 

Awesome plugins! Thank you.

 Signature 

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

Profile
 
 
Posted: 08 July 2010 05:20 AM   [ Ignore ]   [ # 367 ]  
Lab Assistant
RankRank
Total Posts:  119
Joined  04-04-2004
watershed - 26 June 2010 05:05 PM

Hi Laisvunas,
I would pay to help its development. Any other takers?

I´d be interested too.

Cheers
awa

Profile
 
 
Posted: 09 July 2010 10:13 AM   [ Ignore ]   [ # 368 ]  
Lab Assistant
RankRank
Total Posts:  119
Joined  04-04-2004

Hi Laisvunas,
have you ever thought of going commercial with your plugin?
I be happy to pay 10€ - 15€ for THE category plugin, which I think “cild categories” can evolve into.
Frankly, I think, that EEs native category management capabilitys have room for improvment.

I´s like to have a cat plugin, that could be used in a
- single tag version
- version with opening and closing tags

The single tag version would be used with “parse=inward” as Elis plugin VZ Subcategories. (see http://expressionengine.com/forums/viewthread/129357/).
It would be the input for the categories parameter of all those other tags.

The variant with opening and closing tags would display the categories as a list.

Both varants should be extremly configurable.
Basically the plugin should take an category ID (wether static or dynamic) and then I would love to see

- level parameters. Go x levels up or down in the hierarchy starting from where you are

- offset parameters. Go x levels up or down, but DON´T display the next y levels. Example: you´ re on level 3 and want to go 2 levels up, means you end up on the top level. Offset set to 1 would only display the given category + the top level categories, leaving out all cats on level 2.

- Display limitation (show only x cats)

- plus all the stuff, that´s already in. And ported to EE2.

Basically it would be a plugin, that would be the swiss knife converning category manipulation.

What do you think?

Cheers
awa

Profile
 
 
Posted: 09 July 2010 06:48 PM   [ Ignore ]   [ # 369 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  484
Joined  08-31-2004

I would also pay for this for EE2.  Come on, Laisvunas, please bequeath your addon lore to the new platform, despite your reservations wink.

Profile
 
 
   
21 of 21
21