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.

selection of displayed data

May 18, 2010 5:17am

Subscribe [2]
  • #1 / May 18, 2010 5:17am

    Hi,
    just for confirmation, please. I want to display selected data in relation with the content (“choosed content” = one ore more words) of a custom field (“my_custom_field”)

    Is this regular :

    {exp:weblog:entries weblog="my_weblog" my_custom_field="choosed content" orderby="date" sort="desc" limit="5"}
    {title}
    {/exp:weblog:entries}

    or is-it necessary to set condition :

    {exp:weblog:entries weblog="my_weblog"  orderby="date" sort="desc" limit="5"}
         {if my_custom_field="choosed_content"}
             {title}
         {/if}
    {/exp:weblog:entries}

    thank you for help because both seem to be correct but as I tried, none worked.

  • #2 / May 18, 2010 5:48am

    Wouter Vervloet

    758 posts

    Hi Abdellah,

    You should certainly check out the search parameter.

    Yo use it like this if the field should contain the value you’re looking for:

    {exp:weblog:entries weblog="my_weblog" search:my_custom_field="choosed content" orderby="date" sort="desc" limit="5"}
    {title}
    {/exp:weblog:entries}

    If the custom field should be an exact match for your search, it should look like this:

    {exp:weblog:entries weblog="my_weblog" search:my_custom_field="=choosed content" orderby="date" sort="desc" limit="5"}

    Greetz,
    Wouter

  • #3 / May 18, 2010 6:17am

    Hi Greetz,

    it’s great !
    search parameter is documented but I never read it !
    Thank You.

    A little question more :
    is-it enougth fast method to use it often ?
    thank you for this one too.

  • #4 / May 18, 2010 6:34am

    Wouter Vervloet

    758 posts

    A little question more :
    is-it enougth fast method to use it often ?
    thank you for this one too.

    Yes it is… it modifies the SQL query that returns the entries you’re looking for, so it’s as fast as your database can handle.

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

ExpressionEngine News!

#eecms, #events, #releases