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.

{country_code} variable in search result template

November 22, 2010 6:00am

Subscribe [2]
  • #1 / Nov 22, 2010 6:00am

    Silentium

    19 posts

    Hi.

    I’m developing a multilanguage EE2 site. Today when I were creating the search for the site I notice that I can’t use the {country_code} variable in the search result template.

    Instead of getting a value of eg “en”, it get the value “search”. Is there any way to fix this or is there another way to get the country_code in the search result template?

    My code:

    <h1>Search Results</h1>
            {exp:search:search_results}
            
            {if news_intro AND status == "{country_code}"}
            
            <article class="archive">            
                <h2>{title}</h2>
    <p>            <span class="date">{entry_date format="%F %d, %Y"}</span><br />
                <div class="archive_intro">{news_intro}</div><br />
                <a href="http://{path=news/article}/{url_title}" class="right-arrow">Read more</a><br />
            </article><br />
            <br />
            {if:elseif page_content}<br />
            <br />
            <article class="archive">            <br />
                </p><h2>{title}</h2>
    <p>            <span class="date">{entry_date format="%F %d, %Y"}</span><br />
                <div class="archive_intro">{page_intro}</div><br />
                <a href="http://{permalink}" class="right-arrow">Read more</a><br />
            </article><br />
            <br />
            {if:elseif event_intro AND status == "{country_code}"}<br />
            <br />
            <article class="archive">            <br />
                </p><h2>{title}</h2>
    <p>            <span class="date">{event_date format="%F %d, %Y"}</span><br />
                <div class="archive_intro">{news_intro}</div><br />
                <a href="http://{path=events/info}/{url_title}" class="right-arrow">Read more</a><br />
            </article><br />
            <br />
            {if:elseif push_link AND status == "{country_code}_Featured|{country_code}_Top"}<br />
            <br />
            <article class="archive">            <br />
                </p><h2>{title}</h2>
    <p>            <span class="date">{entry_date format="%F %d, %Y"}</span><br />
                <div class="archive_intro">{push_text}</div><br />
                <a href="http://{push_link}" class="right-arrow">Read more</a><br />
            </article><br />
            <br />
            {/if}<br />
            <br />
            {/exp:search:search_results}

  • #2 / Nov 22, 2010 8:13am

    Silentium

    19 posts

    Problem is solved.

  • #3 / Nov 22, 2010 10:46am

    Sue Crocker

    26054 posts

    Glad you were able to figure out what the problem was. Don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases