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.

Can I exclude a category in gallery list?

January 15, 2008 1:15pm

Subscribe [1]
  • #1 / Jan 15, 2008 1:15pm

    Digitalp

    13 posts

    Hi all

    I am using this into my Gallery

    ———————————————————-
    {exp:gallery:categories gallery="{gallery_name}”}
    <form>
    <select name=“URL” onChange=”[removed]=this.options[this.selectedIndex].value”>
    <option value=” “>Select</option> 
    {exp:gallery:category_list gallery="{gallery_name}”}
    <option value=”{category_path=photogallery/category}”>{category_name}</option>
    {/exp:gallery:category_list}
    </select> 
    </form>
    {/exp:gallery:categories}
    ———————————————————

    Is there any way to exclude a specific category off this?

    Thank you for your superb EE…

  • #2 / Jan 15, 2008 1:19pm

    Lisa Wess

    20502 posts

    Welcome to the forums, Digitalp!

    There is not currently a way to do this - no parameter for it, that is. You would probably want to use a custom query if you need this ability.

    You could also add a feature request for this.

    I can move this to how-to if you’d like to see if the community can help with a query? Let me know.

  • #3 / Jan 15, 2008 1:34pm

    Digitalp

    13 posts

    Hi Lisa and thank you.

    I wish to have a quick solution for my gallery. It is a basic for me.

    Do as you like. D

  • #4 / Jan 15, 2008 1:36pm

    Lisa Wess

    20502 posts

    This wiki entry should give you an idea of what the query might look like, but it will need tweaking since it has a different purpose =) Gallery Category Images.

  • #5 / Jan 15, 2008 1:43pm

    Digitalp

    13 posts

    I am not familiar with quieries. Any help will be much appreciated.

    Thank you anyway. I am waiting for someone to have a solution.

  • #6 / Jan 15, 2008 5:09pm

    Digitalp

    13 posts

    Hi Lisa, I have just made it.

    Maybe somebody wants it also. If so just PM me.

    Thank you.

  • #7 / Jan 15, 2008 5:12pm

    Lisa Wess

    20502 posts

    It would be great if you could post it here, or in the wiki.  We love it when people share their solutions, gives future viewers some help.

    Thanks! and glad you were able to come up with a solution!

  • #8 / Jan 15, 2008 5:17pm

    Digitalp

    13 posts

    Ok Lisa.

    Let’s say that we wish category 7 not to be shown.

    ————————————————————————-
    <form>
    <select name=“URL” onChange=”[removed]=this.options[this.selectedIndex].value”>
    <option value=” http://www.oursite.com/photogallery/”>select</option&gt;
    {exp:query sql="SELECT c.cat_id, c.cat_name, c.cat_description FROM exp_gallery_categories AS c, exp_galleries WHERE c.gallery_id = exp_galleries.gallery_id AND exp_galleries.is_user_blog = 'n' AND exp_galleries.gallery_short_name = 'photogallery' AND c.cat_id != 7"}
    <option value=”{path="photogallery/category}C{cat_id}” id=”{cat_id}”>{cat_name}</option>
    {/exp:query}
    </select>
    </form>
    ————————————————————————

    That’s all. Works fine.

    Digitalp

  • #9 / Jan 15, 2008 5:22pm

    Lisa Wess

    20502 posts

    Thanks, Digitalp!

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

ExpressionEngine News!

#eecms, #events, #releases