We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Variable excerpt when displaying search results

Development and Programming

Activeark's avatar
Activeark
2 posts
13 years ago
Activeark's avatar Activeark

Hey everyone! I have a multi-language site that has a search function. Now each language has its own custom field in a channel for example: body_en, body_es, body_de.

The problem is that in the channel properties I can only define ONE field as the default excerpt field.

Therefore I’m trying to find out weather its possible to call a variable excerpt field when outputting to a search results page, based on the language version.

Something along the lines of this would be perfect!:

{if '{language_code}' == 'en'}
 {excerpt field="blurb_en"}{read_more}
{if:elseif '{language_code}' == 'es'}
 {excerpt field="blurb_es"}{read_more}
{if:else '{language_code}' == 'de'}
 {excerpt field="blurb_de"}{read_more}
{/if}

I’m already using ‘Search Results v1.3.4’ and this gives me the option of outputting custom fields, but not the excerpt field.

Any suggestions would be greatly appreciated!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.