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.

Best way to hide posts that are in certain category group, even if in another category group

June 27, 2011 11:30am

Subscribe [6]
  • #1 / Jun 27, 2011 11:30am

    willm

    30 posts

    As an example, I have products in one category group (e.g. promotional) that are also in other category groups (e.g. Gender, Type).

    What I want to do is only show entries that are NOT in the ‘promotional’ category group, regardless of whether they are in ‘Gender’ or ‘Type’. I thought using the category_group=“not X” would work, but it still shows the ‘promotional’ entries that are also in other category groups.

    Just wondering if anyone had any thoughts on the best way to achieve this?

  • #2 / Jun 27, 2011 5:55pm

    Matt:P

    277 posts

    Hi Willm

    I started writing detailed reply which was totally incorrect…

    Does this help (Low Seg2Cat) courtesy of Mark Bowen’s answer to this thread: http://ellislab.com/forums/viewthread/191950/ ?

  • #3 / Jun 28, 2011 5:23am

    John Henry Donovan

    12339 posts

    willm,

    Let us know if Matt’s link works.

    If not can you tell us what version and build of EE a you are using?
    What does the URL to the page you are testing with look like and what do you have in your template so far?

  • #4 / Jun 28, 2011 7:23am

    willm

    30 posts

    Hi Matt & John,

    Thanks for your help, I hadn’t thought of doing it that way, but anyway the entries are listed on the homepage of the site, so no segments! I think I’d still run into the same problem though.

    The products won’t show as long as they are exclusively in the category group I don’t want to show. If they’re in any other category groups that I do want to show, then they show. Heres the code I’m using for the channel:entries tag:

    {exp:channel:entries
        channel="products"
        category_group="not {embed:exclude_cat_group}"
        dynamic="no"
        disable="member_data|pagination"
        sort="asc"}

    Is the only way to do this by using statuses? I’d rather not add that additional step for the client.

  • #5 / Jun 28, 2011 7:42am

    Matt:P

    277 posts

    John Henry, I’m sure I’ve read an article about how to achieve this, but can’t for the life of me find it.

    Can you use Logical Operators described here for more than one category-filter?

  • #6 / Jun 29, 2011 4:19pm

    Kevin Smith

    4784 posts

    Hi willm,

    The way the category_group parameter works when you add “not” to exclude categories is to just not look in that category for entries. It doesn’t make sure that no entries from that category are shown. Changing this behavior would break a lot of ExpressionEngine sites, so I’d recommend adding a feature request asking for some way to achieve the result you’d like to see. I can definitely see your need being something worthwhile though; perhaps a new parameter like category_exclude_entries would be in order. Make your case in the feature request forum!

  • #7 / Aug 16, 2011 6:25pm

    Krake

    72 posts

    Hi there

    I’m using GWcode Categories add-on (free) with great success. With this one you can basically do whatever you like with your entries and categories.

    Check out the reviews on Devot:ee.

    -Kath

  • #8 / Aug 17, 2011 3:26am

    John Henry Donovan

    12339 posts

    @Matt. Cant recall that article unfortunately.

    Thanks for the tip on the add-on Kath. Does that help you ?

  • #9 / Sep 14, 2011 9:50am

    willm

    30 posts

    Sorry for the slow reply on this…

    GWcode Categories did the trick! Lots and lots of options with it, the one i need was excl_group_id.

    Thanks Kath and everyone for their help.

    Will

  • #10 / Sep 14, 2011 10:56am

    Sue Crocker

    26054 posts

    Glad to hear the solution worked for you… If anything else comes up, please do let us know in a new thread..

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

ExpressionEngine News!

#eecms, #events, #releases