• Hi

    I love CataBlog. Is very easy to install and use. But… I have a question about the operator code to filter the categories for display.

    Is there any way to do the following query and if so how:

    ItemA is a member of 2 categories x,y
    ItemB is a member of 1 category x

    How can I filter so that items of category x BUT NOT category y result? i.e I only want to display itemB in my page.

    I cannot use category=”y” operator=”not in” because I would have to have a huge list of other categories that would show up but I could use category=”a,b,c,d, … y,z” operator = “not in” but it doesn’t seem that elegant a solution and would probably be horrendous in terms of query speed.

    I would appreciate an thoughts you may have.

    Thanks
    JOL

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hey jol2011,

    I’m gonna have to think about this one for a minute. I can say that the operator function in CataBlog is directly related to WordPress’s own query function operator. I think it’s new in WordPress 3.1 and you might be able to learn more about it at this URL:

    http://codex.wordpress.org/Function_Reference/WP_Query#Taxonomy_Parameters

    So as I look further into your question I realize that it is possible with the custom taxonomy query array. I will need to think how to implement this within the shortcode though, since shortcodes do not really allow for array parameters. Maybe something along these formats would work for a future version, but I have no idea until I do further testing.

    This could work for sure, but I worry about all the conditional code I would have to write for possibly different operator values.
    [catablog category="dogs,cats" operator="IN,NOT IN" order="title"]

    I think that the second category will override the first, but maybe they will merge into an array…
    [catablog category="dogs,IN" category="cats,NOT IN" order="title"]

    Thread Starter jol2011

    (@jol2011)

    Thanks for that macguru2000.
    Perhaps there could be something like:

    [catablog category=”dogs,cats” operator=”IN” category2=”pets” operator2=”NOT IN”]

    Not really sure how the short code works and how many params you are allowed.

    Thanks again for taking a look.

    Hello macguru2000,

    I just started using catablog and find it very user friendly. I noticed that when I click on the main image it gets bigger and under the photo is a large white space. Is it possible for me to put a text in that white space under the photo? This would be useful for comments and product descriptions. Thanks for your work.

    Hi speaking for the ignored,

    If you are referring to the white space under the image in the LightBox, all you need to do is put some content in your catalog item’s description. Both built in templates (default and gallery) support displaying the item’s description in the LightBox. This description can even contain a buy now button or other simple HTML. Good luck and I hope that helps.

    Hey macguru2000,

    I believe you that the item’s descriptions are there. I just can’t see them. I also read of an earlier problem with the font color and background color of the lightbox bothe being white.
    You wrote:

    “stackstudio,
    if you want the text to be white in the description and another color in the lightbox then you should create a more intricate CSS solution. For instance you should be using classes and not inline style tags, as they cannot be overridden or you can use actual HTML tags in your CSS selectors as well, such as:
    .catablog-description strong {
    color: white;
    }

    .catablog-lightbox-desc strong {
    color: black !important;
    }

    This sounds like a great fix except that I don’t know how to use it. How do I “use actual HTML tags in my CSS selectors? Can you help coach me through this a little? I would greatly appreciate it.

    Hey speaking for the ignored,

    Choosing and setting up CSS selectors is something of an art, but understanding the syntax is super easy. I would recommend you read more about CSS and how it works at w3schools.com. Here is an example CSS class:

    .catablog-lightbox-desc strong {
        color: black !important;
    }

    A simple CSS class like this one is designed to turn the font color all strong HTML tags inside of a HTML tag with the class of ‘catablog-lightbox-desc’ black. A CSS class consists of a path if you will. Starting on the left, each new element in the path must be a decedent of the first element for the rules to be applied. So if you wanted to change all paragraph in a table that are in a HTML element with a class of content it would look like this:

    .content table p {
        font-size: 12px;
    }

    If you take the first example and put it in your styles.css file in your theme, or in a new catablog.css file in your theme’s folder it will be loaded and change the color of the description in the LightBox. Good luck and if you haven’t already, please:

    Rate and confirm that CataBlog works
    http://wordpress.org/extend/plugins/catablog/

    Like the Facebook page
    http://www.facebook.com/catablog

    Donate to help the continued development of CataBlog
    http://catablog.illproductions.com/donate/

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘[Plugin: CataBlog] Operator question’ is closed to new replies.