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.

exp:query - strange issue since 1.6

June 23, 2007 12:18pm

Subscribe [1]
  • #1 / Jun 23, 2007 12:18pm

    Geri

    2 posts

    Hi everybody,

    i´m running into a strange output since update to 1.6:

    I built following query within an exp:weblog:category_heading to output next level of subcategories of a given category (short version):

    {exp:weblog:category_heading weblog="{my_weblog}"}
    <h2>{category_name}</h2>
    <p>Subcategories:     <br />
    {exp:query sql="SELECT cat_name, cat_id FROM exp_categories WHERE parent_id = '{category_id}' "} <br />
    {if count > 1}, {/if}<br />
    <a href="http://{path={my_template_group}/C{cat_id}}">{cat_name}</a><br />
    {/exp:query}</p>
    
    <p>{/exp:weblog:category_heading}

    That looked like:

    Main Category
    Subcategories: Cat1, Cat2, Cat3

    Since update 1.6, the query runs okay so far, but “cat_name” and “cat_id” does not have any value. Paradoxically it counts the subcategories right.
    In the html-source that looks like:

    <a href="http://anything/journal/C/"></a>, 
    <a href="http://anything/journal/C/"></a>

    Template-Debugging doesn´t show any malfunction.
    If i´m running the exp:query outside “category_heading” pair, all is okay. But i need it in, to give

    parent_id = '{category_id}'

    .
    Maybe i´m missing something? Any clue?

    thanks for help, Geri

  • #2 / Jun 24, 2007 9:48am

    Derek Jones

    7561 posts

    The category heading tag is attempting to parse those variables as category custom fields, which is replacing them as “empties” before you query tag is parsed.  I’ve modified category field parsing to be more discrete, and it will be included in the next build update.  A temporary solution for you is to move the query tag to an embedded template, and pass the category_id with an embed variable.

  • #3 / Jun 24, 2007 5:59pm

    Geri

    2 posts

    Thank´s for info, Derek. I will await next build to fix that.

    p.s.: new features in 1.6 are great. Keep on your good work and excellent support!

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

ExpressionEngine News!

#eecms, #events, #releases