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.

Query category custom fields

January 23, 2009 6:28am

Subscribe [0]
  • #1 / Jan 23, 2009 6:28am

    [/root.]

    29 posts

    Greetings,

    I use categories for the city names but sometimes I need to change the ending of the city (the site is not on English, so it is possible 😊), so I have created a “plural” custom field for my categories which contains the proper variation. Now I need to add specify this field to the next construction:

    <a href="http://" title="{plural}">link</a>

    which is basically a sidebar box with some static links i.e outside any EE tags.

    As I understand the query should know from which category it should put the custom field, so I’m using the cat_url_title in my first segment.

    Here is my query, unfortunately it’s not working

    {exp:query sql="SELECT * FROM exp_categories, exp_category_fields, exp_category_field_data WHERE cat_url_title = '{segment_1}'"}{plural}{/exp:query}

    Any ideas how to approach to my problem? Thanks.

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

ExpressionEngine News!

#eecms, #events, #releases