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.

Search Reults conditionals

July 10, 2011 5:34pm

Subscribe [2]
  • #1 / Jul 10, 2011 5:34pm

    Marc Miller

    84 posts

    In EE1, I could customize my search results page depending on the weblog being returned. ie:

    {exp:search:search_results}
      <a href="http://{auto_path}">{if weblog_id=="7"}{programid} {/if}{title}</a>
    
      {if weblog_id!="7"}<strong>Section:</strong> {weblog} {if:else}<strong>Category:</strong> {categories backspace="2"}{category_name}, {/categories}{/if}
    {/exp:search:search_results}

    But it seems I can’t do something similar in EE2.

    {exp:search:search_results}
      <h5><a href="http://{auto_path}">{title}</a></h5>
    <p>  {if channel_id=="17"}{full_text}{if:else}{excerpt}{/if}<br />
    {/exp:search:search_results}

    So is channel_id not available in EE2 search results tag? Thanks.

  • #2 / Jul 11, 2011 12:38pm

    Sue Crocker

    26054 posts

    Hi, Mark.

    Sure, you can use channel_id in there.. I’m echoing it out in this example.

  • #3 / Jul 11, 2011 12:45pm

    Marc Miller

    84 posts

    Ok thanks Sue. I must have something else going on then. Thanks!

  • #4 / Jul 11, 2011 1:06pm

    Sue Crocker

    26054 posts

    Marc, I’m going to go ahead and close this - If anything else comes up, please do let us know in a new thread..

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

ExpressionEngine News!

#eecms, #events, #releases