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}