GWcode Categories Support

Page 6 of 6. ‹ First  < 4 5 6

Avatar for Leon Dijk

Author

#1 By Leon Dijk @ June 07th, 2012 18:26 (74 months ago)

Hi Tim,

It should only force a simple list if that's the only option. Using the orderby parameter might cause that.

For example, let's say you have a category structure which has a category "Cat A1" which is a child category of "Cat A".

Sorting the category with the orderby parameter might cause the "Cat A1" to be somewhere at the bottom of the category list, while "Cat A" might remain somewhere at the top of the list. So, the list of categories has a totally different order, which means that it may no longer output as nested. Does that make sense?

Avatar for Francheska

#2 By Francheska @ June 22nd, 2012 19:26 (73 months ago)

I have a question, am I able to filter with categories or segments?

For example,

<div id="filter1">
<input type="{category_name}" checked="checked" /><label for="radio01">CATEGORY 1</label>
<input type="{category_name}" checked="checked" /><label for="radio01">CATEGORY 2</label>
<input type="{category_name}" checked="checked" /><label
for="radio01">CATEGORY 3</label>

</div>

<div id="filter2">
<input type="{category_name}" checked="checked" /><label for="radio01">CATEGORY 4</label>
<input type="{category_name}" checked="checked" /><label for="radio01">CATEGORY 5</label>
<input type="{category_name}" checked="checked" /><label
for="radio01">CATEGORY 6</label>

</div>

<div id="filter3">
<input type="{category_name}" checked="checked" /><label for="radio01">CATEGORY 1</label>
<input type="{category_name}" checked="checked" /><label for="radio01">CATEGORY 2</label>
<input type="{category_name}" checked="checked" /><label
for="radio01">CATEGORY 3</label>
</div>

<div class="results">filtered results</div>

Avatar for Francheska

#3 By Francheska @ June 22nd, 2012 19:32 (73 months ago)

And by that, also, the user would be able to choose 1 or more. If they choose to use all 3 filters, the results would be smaller. Am I able to accomplish this with this plugin?

Avatar for Tim Kelty

#4 By Tim Kelty @ June 22nd, 2012 21:56 (73 months ago)

@Leon Dijk yep, it does. Thanks.

Avatar for Alli

#5 By Alli @ June 25th, 2012 22:10 (73 months ago)

I am trying to produce a safecracker form that shows a list of dropdown list of countries (parent categories).
I would like to dynamically show the subcategories (regions) in a second dropdown when a country is selected.

Can you suggest how I can achieve this?
Thanks

Avatar for Samuel Allen

#6 By Samuel Allen @ July 09th, 2012 17:42 (73 months ago)

Is there a way to paginate using this plugin?

Avatar for Faith

#7 By Faith @ July 11th, 2012 09:18 (72 months ago)

Dear all,

I have found a very annoying misbehavior. I have created categories like that:
*M1
*M2
**M2.1
**M2.2
*M3
**M3.1
**M3.2
*M4
**M4.1
**M4.2
*M5

I have 5 root categories. I’ve created a list with this code:

{exp:gwcode_categories channel="products_de" group_id="3" style="linear" custom_fields="yes"}
  {if depth1_start}
    Level1-Start: {cat_name}<br>
  {/if}
    Other levels: {cat_name}<br>
  {if depth1_end}
    Level1-End: {cat_name}<br>
  {/if}
{/exp:gwcode_categories}

and the result was:

      Level1-Start: M1<br>
      Other levels: M1<br>
          Other levels: M2<br>
          Other levels: M2.1<br>
          Other levels: M2.2<br>
      Level1-End: M2.2<br>
          Level1-Start: M3<br>
      Other levels: M3<br>
          Other levels: M3.1<br>
          Other levels: M3.2<br>
      Level1-End: M3.2<br>
          Level1-Start: M4<br>
      Other levels: M4<br>
          Other levels: M4.1<br>
          Other levels: M4.2<br>
      Level1-End: M4.2<br>
          Level1-Start: M5<br>
      Other levels: M5<br>
      Level1-End: M5<br>

The big problem is, why the M2 is not managed like other root categories. I’ve tried anything, and I am going crazy. I have created new category group, etc. Nothing. The 2nd root category is always skipped. Please try to help me. I spent hours on this issue…

Thanks in advance!
István

Avatar for Leon Dijk

Author

#8 By Leon Dijk @ July 11th, 2012 21:07 (72 months ago)

Hi István

The reason is that {if depth1_start} is not true when M2 starts (because M1 doesn't have any child categories, depth1 doesn't "start" with M2).

Try using {if has_children} instead to see if that solves it?

Avatar for Ngon Com

#9 By Ngon Com @ July 13th, 2012 05:48 (72 months ago)

Hi Developer!

I have a category structure like that:

- Category A
- - Category A1
- - Category A2
- Category B
- - Category B1
- - Category B2

And I want create a list base on this:

If when I click "Category A", I have a list:

- Category A (class=selected)
- - Category A1
- - Category A2
- Category B

When I click to "Category A1", it same above + add class=active:

- Category A (class=selected)
- - Category A1(class=active)
- - Category A2
- Category B

When I click to "Category B", I have a list:

- Category A
- Category B (class=selected)
- - Category B1
- - Category B2

I have spent alot of time and going crazy but seem my problem not fixed!

P/S: here is my code:


<ul class="cnv-subCat-1">
{exp:gwcode_categories group_id="{master_groupid}" depth="1|2" style="linear" entry_count="yes"}
{if depth == 1}<li class="">{cat_name}{/if}
{if depth == 2}{if segment_3 == cat_url_title OR segment_3 == parent_url_title}
{if depth2_start}<ul>{/if}
<li class="">{cat_name}</li>
{if depth2_end}</ul>{/if}
{/if}{/if}
{if depth1_end}</li>{/if}
{/exp:gwcode_categories}
</ul>

Seem it work on some case but it can not add "class=selected" to the parent when I click on its child (it not add "class=selected" to Category A when I click on Category A1)

Thank you very much!

Avatar for martin allman

#10 By martin allman @ July 14th, 2012 22:47 (72 months ago)

Hi
I wish for front end users to login via a safeform and see a list of categories that I have associated them with. I wish for them only to

see/edit parent categories/children that I have associated them to.  At present thay can see all categories, could I use this plugin to

restrict the view?

{exp:safecracker channel="directory" }
{categories}
  <label><input type="checkbox" name="category[]" id="{category_name}" value="{category_id}"{checked}>{category_name}</label>
{/categories}
<input type="submit" name="submit1" value="Submit">
{/exp:safecracker}

Avatar for Mike

#11 By Mike @ July 29th, 2012 19:06 (72 months ago)

@Ngon Com

I just did something simialr recently…my code is below. I basically used a combination of GWCode variables and variables grabbed using the LowSeg2Cat plugin.

{exp:gwcode_categories}
{cat_name}
{/exp:gwcode_categories}

Avatar for Mike

#12 By Mike @ July 29th, 2012 19:07 (72 months ago)

woops, here s the code…


{exp:gwcode_categories}
 {cat_name}
{/exp:gwcode_categories}
Avatar for Mike

#13 By Mike @ July 29th, 2012 19:09 (72 months ago)

shit, haha, this is the last time, if it doesn't work, email me.

{exp:gwcode_categories}
 <a href="{path=products/valves-and-nozzles/{complete_path}}" {if cat_id == last_segment_category_id}class="active"{/if}{if cat_name == segment_3_category_name}class="active"{/if}>{cat_name}</a>
{/exp:gwcode_categories}
Avatar for Ngon Com

#14 By Ngon Com @ July 30th, 2012 05:00 (72 months ago)

@Mike, thank you very very much!

That a pity, I've test and it not work.

And variable "segment_3_category_name" not work to.

Thank!

P/S: seem "GWcode CatMenu" is suiable for me in this case, but I can't add class as easy as using "GWcode Categories", I still want to use "GWcode Categories" much!

Avatar for Mike

#15 By Mike @ July 30th, 2012 05:02 (72 months ago)

Did you also install the LowSeg2Cat plugin? you need it for the "segment_3_category_name" variable.

Avatar for Ngon Com

#16 By Ngon Com @ July 30th, 2012 16:17 (72 months ago)

@Mike: No, I am not using "LowSeg2Cat".

But if I install this plugin, your above code snippet still not working as expected, I think so!

I really like it work as "GWcode CatMenu".

Thank Mike!

Avatar for Joe

#17 By Joe @ July 31st, 2012 16:47 (72 months ago)

Thanks for the great plugin!  Is there a way to replicate the native category_archive function?  Specifically, I'd like to list all entries belonging to each category, ie:

{exp:channel:category_archive channel="news" disable="category_fields" show_empty="no"}

     {categories}
      <h2>{category_name}</h2>
     {/categories}
     
         {entry_titles}
          
         {title}
         {/entry_titles}
     
    {/exp:channel:category_archive}

Thanks!

Avatar for Mike Stecker

#18 By Mike Stecker @ September 17th, 2012 20:50 (70 months ago)

Would you be able to add support for the ability to order by the most recently updated category? Also, to get the return the date of the oldest and the newest entries inside each category? I would love to be able to do something like:

Cat 4 (Jun 2012 - Oct 2012)
Cat 3 (Jun 2012 - Aug 2012)
Cat 1 (Jan 2012 - Apr 2012)
Cat 2 (Feb 2012 - Mar 2012)

Avatar for 12D40

#19 By 12D40 @ September 28th, 2012 10:32 (70 months ago)

Hello Leon,

im tying to my a dropdown with your code but i dont seem to get it right.

working with bootstrap http://twitter.github.com/bootstrap/components.html#dropdowns
and i have 3depths of categories, not all have children, i have managed to get the second depth working but nothing close yet for depth three, im doing something like


<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Collectie <b class="caret"></b></a>
<ul class="dropdown-menu">
{exp:gwcode_categories channel="products" style="linear"}
{if depth1_start}
<li class="dropdown-submenu">
<a href="#">{cat_name}</a>
{/if}
{if depth2_start}
<ul class="dropdown-menu">
{/if}
{if depth == 2}
<li><a href="#">{cat_name}</a></li>
{/if}
{if depth2_end}
</ul>
{/if}
{if depth1_end}
</li>
{/if}           
{/exp:gwcode_categories}
</ul>
</li>
Avatar for Kevin

#20 By Kevin @ October 13th, 2012 07:59 (69 months ago)

Hi, love this… thanks

I'm using the following to load a menu - using category children:

{exp:gwcode_categories channel="years" cat_url_title="{last_segment}" style="linear" output_depth="0|2"}
<li >
{cat_name}</li>
{/exp:gwcode_categories}

Works great when I navigate to the page featuring the menu but I would like to still show show the menu after a menu item (category child) has been clicked - is that poss? at the moment with the above, when a menu item is clicked, the menu shows only that item (which has been clicked - and not all).

Thanks!

Avatar for kevin

#21 By kevin @ October 13th, 2012 08:03 (69 months ago)

Sorry!


{exp:gwcode_categories channel="years" cat_url_title="{last_segment}" style="linear" output_depth="0|2"}
<li >
{cat_name}</li>
{/exp:gwcode_categories}

 

Avatar for Kristen Grote

#22 By Kristen Grote @ October 25th, 2012 19:18 (69 months ago)

How do I output information for the currently selected category only? I'm trying to output custom category fields on a Zoo Triggers listing so I can't use the {exp:channel:category_heading} tag.

So if my URL is http://www.mysite.com/products/category/tools/hammers - how do I output the custom category fields for just the "Hammers" category?

I got as far as setting cat_url_title="{triggers:segment_4}", but all of the parameters seem to deal with outputting either the parents or children of the selected category, not just the category itself.

Avatar for Mark Dodgson

#23 By Mark Dodgson @ November 13th, 2012 20:25 (68 months ago)

Love the plugin. Thanks for sharing. I do have a quick question. I'm struggling to find a way to output "Category Group Names". I have 9 Category groups with categories within each of these groups. I would really like to display a list of the Category Group names.

Is this possible? If not, is there a way to have all categories within 1 Category group and then produce the following scenario.

I have a number of entries that have been tagged with a series of categories (ie. brand name (chosen from a list of brands), type of product (again, chosen from a list of products), etc.. I only want to display a list of brands, types of products, etc. that have been tagged (ie. if a category hasn't been used, I don't want to display it in the output list.

Any thoughts.

Avatar for Ngon Com

#24 By Ngon Com @ December 11th, 2012 05:59 (67 months ago)

Hi author!

How can I list categories with 2 its entries?

My categories structure like:


- Category 1
- Category 2
- Category 3

And I want a list:


- Category 1
     Entry 1
     Entry 2
- Category 2
     Entry 1
     Entry 2
- Category 3
     Entry 1
     Entry 2

Thank you very much!

Avatar for Kevin

#25 By Kevin @ December 11th, 2012 18:28 (67 months ago)

Hi Leon, loving your plugin! it is working great
I cant seem to figure this out,
I am doing a nested drop down list looking Like this

Parent Category 1
- Children 1
- Children 2

Parent Category 2
- Children 1
- Children 2

Parent Category 3 (With No Children)
Parent Category 4 (With No Children)

but for some reason I cant select the Parent Category 3 as an option,
when it does not have any children with it

here is the code I have


<select name="categories[]">
<option value="">Pick a Category</option>
{exp:channel:categories channel="mychannel" disable="category_fields" style="linear"}
{if parent_id == '0'}{if count != '1'}</optgroup>{/if}
<optgroup label="{category_name}">{/if}
{if parent_id != '0'}<option value="{category_id}" name="{category_id}">{category_name}</option>{/if}
 {/exp:channel:categories}
</select>

any help is appreciated, thanks!

Avatar for Dustin Hansen

#26 By Dustin Hansen @ January 08th, 2013 04:31 (66 months ago)

Is this extension somehow not compatible with Freebie?

I am totally stumped.  I have "locations" set up as a breaking segment in Freebie.  I then visit /locations/illinois.  The template is the following code:


{exp:gwcode_categories
  show="9"
  style="linear"}

  test1-{cat_url_title}
  {if freebie_2 == "illinois"}
      test2
  {/if}
  {if freebie_2 == "{cat_url_title}"}
      test3
  {/if}

{/exp:gwcode_categories}

This output:

test1-illinois
test2

Why won't it display test3??  It makes zero sense…?  Clearly the {cat_url_title} is equal to "illinois" and so is {freebie_2}.  Can anyone lend an idea??  Banging my head against a wall here.

Avatar for Tim Murtaugh

#27 By Tim Murtaugh @ January 09th, 2013 20:56 (66 months ago)

belay my last comment — I was looking at the wrong category group.

Avatar for Sam Ryde

#28 By Sam Ryde @ January 11th, 2013 11:43 (66 months ago)

Hi Leon,

I am trying to use gw_code categories for an ecommerce store.

However I need to not show categories, where the entries are closed.

Can gw_code categories do this. I have tried the show_empty, but the cats seem to show when they have entries, open or closed.

Many thanks,
Sam

Avatar for Mike Stecker

#29 By Mike Stecker @ January 14th, 2013 17:57 (66 months ago)

Is is possible to sort the categories list by the most recently updated content inside each category? Meaning that the order of the categories are driven by the content inside each category?

Avatar for Josh

#30 By Josh @ January 14th, 2013 20:49 (66 months ago)

Leon,
I'm trying to a exclude category from results and I have everything working except that the numer of entries that are in that category aren't removed from {entry_count} These items are also in other categories, is there a way to exclude any entry that is in X category?  Below is my code:


{exp:gwcode_categories channel="music|products" cat_id="{segment_2_category_id}" entry_count="yes" incl_self="no" excl_cat_id="191" show_empty="no" cat_id="31" status="Open"}
 {if cat_count == "1"}
  <h3>{segment_2_category_name} Categories</h3>
 {/if}
  {cat_name} ({entry_count})
{/exp:gwcode_categories}
Avatar for kevin

#31 By kevin @ January 16th, 2013 19:42 (66 months ago)

Hi,
I wanted to be able to get the last_only categories, restricted by both a top level cat_id and an entry_id. The code below works for one or the other, but they don't work together. Is this not meant to work? Is there a better way?

(BTW, thanks for sharing this plugin. It's been a lifesaver!)


{exp:gwcode_categories cat_id="1001" entry_id="791" last_only="yes"}
    CAT:{cat_name}
{/exp:gwcode_categories}
Avatar for Jon Nixon

#32 By Jon Nixon @ February 02nd, 2013 19:54 (66 months ago)

Hi,

I'm sure there is a very simple way to do this using some for of count, however I can't figure it out. I'm trying to only output the {parent_name} one time when there are multiple sub/child-categories like this:

Parent Category Title A
  - Child category title
  - Child category title

Parent Category Title B

This is what I have (sans any of the count methods I've tried):

            {exp:gwcode_categories
            channel="blogs"
            style="linear"
            show_empty="no"
            dynamic="no"
            depth="1|2"
            output_depth="1|2"
            entry_count="yes"
            }
            
                {if depth == 2}
                    <strong>{parent_name}</strong> 
                    {embed="blogs/blogger-profile" category_name="{cat_name}" category_id="{cat_id}" }
                     
                {/if}
            
            {/exp:gwcode_categories}
   

Thanks for any help.

Best,

Jon

 

Avatar for Jae Barclay

#33 By Jae Barclay @ February 02nd, 2013 20:14 (66 months ago)

Hi Leon,

Is there a way to do a prev/next category links with GWCode Categories add-on?

It will work just like the prev/next entry links, except it will go back/forth between categories, also detecting any "empty" categories and skipping it.

Thanks so much!

Jae

Avatar for Samuel Allen

#34 By Samuel Allen @ February 03rd, 2013 20:45 (66 months ago)

It looks like a few others have asked my question here, but I don't see an answer yet.  I'm trying to use GWCode Categories in a safecracaker form.  I'm not seeing any way to evaluate whether a category has been selected.  Using the default {checked} parameter does not appear to work.

Is this possible?  I've tried using a normal {categories} tag pair inside my channel entries loop, but I can't get the {parent_id} variable to parse while GWCode Categories is installed (which I need in a few places on the site).

If there's a way to solve either issue, I would be grateful.

Avatar for Garrett

#35 By Garrett @ February 06th, 2013 23:30 (66 months ago)

Is it possible with gwcode_categories or catmenu to get something like {child_category_count}? for instance, I am iterating through a single category group that consists of categories, some of which have child categories. When the loop comes to a category that has children, I would like to know how many children it has so that I can apply a particular class if the category has more then X number of child categories.

Avatar for Mark

#36 By Mark @ February 07th, 2013 23:03 (65 months ago)

I've just started using GWCode Categories for the great time, and have seen it oft-cited as a go-to solution on EE StackExchange.

I need to rely on nested output for navigation, but I need classes on the

<li>
(similar to Structure's output). I see that there are variables to check for "has children" and I could compare cat_url_title to my segment vars to get the "here" status, but I don't see a way to get those onto the
<li>

.

Are those sorts of classes supported on the

<li>
and I'm missing something? Or is there a way to get nested output and write my own
<li>

tags?

Thanks!

Avatar for James

#37 By James @ February 12th, 2013 19:51 (65 months ago)

Hi All,

Looks like its been a while since there has been a post. Can someone confirm that the plugin still works with latest EE. I have spent about 5 hours with the navigation example and its not working as it the example suggests. I have tried everything!

Regards,

James.

Avatar for James McFall

#38 By James McFall @ March 19th, 2013 23:30 (64 months ago)

Hey Leon,
I believe I may have found an issue with GW Categories.

For your reference, my category structure is:

* GPS Equipment
* Optical
** Levels
** Theyodolites
** Total Station
* UAV

Outputting this with the standard tags is fine:
{exp:gwcode_categories channel="products"}
{cat_name}
{/exp:gwcode_categories}

However when I use either my own hand built code (based on the documentation) or a copy of your http://gwcode.com/add-ons/gwcode-categories/examples/example11 code, my "Optical" category is excluded and it's children are shown under "GPS Equipment".

It outputs as:
* GPS Equipment
** Levels
** Theyodolites
** Total Station
* UAV

I can see there has't been any activity on this support page for a long time so I'm going to start debugging myself for the meantime.

Avatar for Robby Bates

#39 By Robby Bates @ January 24th, 2014 00:22 (54 months ago)

Here's my code—I'm trying to use the stashed value "jumbo_cat_ids" inside the category parameter. It's not working what do you see that's wrong?
———————————————————————————-


{exp:stash:set parse_tags="yes" parse="inward"}
  {stash:jumbo_cat_ids}
    175&{exp:gwcode_categories channel="{segment_1}" cat_url_title="{segment_2}" style="linear"}{cat_id}{/exp:gwcode_categories}
  {/stash:jumbo_cat_ids}
{/exp:stash:set}

<section>
  <div class="jumbotron">
  <div class="container">
    <div class="row">
      <div class="text-left col-xs-12 col-sm-12 col-md-6 col-lg-6">
        <h1>{embed:section_name}</h1>
      {if segment_2==""}
      <h2> Our Package offerings for Leagues and Clubs and Teams or groups etc…</h2>
  {if:else}
  {exp:channel:entries channel="{embed:section_name}" category="{exp:stash:get name=‘jumbo_cat_ids'}" limit="1"}
          {title}
        {/exp:channel:entries}
      {/if}
      </div>

    </div>
    </div>
  </div>
  </div>
</section>

Submit your comment

Sorry, comments are closed for this page.