Results 1 to 5 of 5

Thread: Conditionals giving me headaches

  1. #1
    New user
    Join Date
    06-08-10.
    Posts
    3

    Default Conditionals giving me headaches

    Hi, I am new to Typolight and i have to say I love it. I currently have a two language website set up (french and english), and have recently added the catalog module. I have many products, which are sorted in different product categories. I want to be able to have a page that lists only the products of a certain category, so i have set up a list module, but I am unsure on how to write the conditional statement for it to work. I have been searching the forums for an answer, and have found some people with similar problems, but still couldnt figure it out.

    The product categories are set in Taxonomy, in both french and english. For example, i have a category called Wrappers, which's information in taxonomy is the following:

    ID: 2
    Parent ID: 1
    Sorting value: 128
    Revision date: 2010-06-07 17:00
    Name: Wrappers
    Alias: wrappers

    I have many products in that category, and i want a conditionnal that will enable me to list only the products in that category for my list module.

    How can this be done?
    Thank you

  2. #2
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Conditionals giving me headaches

    The catalog is an advanced module, not for beginners.

    Maybe it's time you guys invest some effort into reading the tutorials. Conditional statements is covered in a very advanced way... Also, the condition clause is nothing more than SQL, so go learn SQL first, then come back if you don't understand how to apply your SQL to the module correctly.

  3. #3
    New user
    Join Date
    06-08-10.
    Posts
    3

    Default Re: Conditionals giving me headaches

    I've been spending the past three days trying to figure this out, reading every single tutorial on the website, and then reading every forum post that could have a link with this, and only in last resort did I register on the forums to ask. I have a basic knowledge of SQL and PHP, I am just unsure of how to formulate the SQL and apply it to the module correctly. Right now I am trying to achieve this using the list module and applying a conditional.

    I've been trying different InsertTags, and none seem to do the trick :S
    This is what i was trying, but there must be something wrong with it: {{catalog:roduct_category}}="Wrappers"

    I know you probably are really busy, but this has been driving me crazy and a little help would really be appreciated :?

  4. #4
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Conditionals giving me headaches

    SQL uses normal catalog fieldnames, you don't have to put them in inserttags at all.

    Normal SQL code for a query would be:
    Code:
    WHERE status=4
    and that would translate in your Catalog List Module condition clause to:
    Code:
    status=4
    you will therefore have to know the ID numbers of any references to taxonomy that you use (just hover to look at them), as you can't use text values, as these are NOT stored in the database, only the ID value is stored (smallest footprint).

    The list cannot accept any catalog inserttags, because none of them would have a value. Catalog inserttags can only be used on a READER module anyways, so only related, reference and another list, referencing some field value on a reader page will work.

    You CAN however always use TL_insertags in the condition clause, e.g. to filter a list based on the page you're on, e.g.

    Code:
    pagefilter={{env::page_id}}
    would insert the current page ID to make pagefilter=5.

  5. #5
    New user
    Join Date
    06-08-10.
    Posts
    3

    Default Re: Conditionals giving me headaches

    I just got it to work. Stupid mistake :x : I thought you had to select Enable Conditional List for the conditionals to work :roll: So i unchecked it, and entered this condition: product_category=2 and it worked!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •