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

url-title?

Development and Programming

aling01's avatar
aling01
6 posts
11 years ago
aling01's avatar aling01

I have an event block that displays images.

I want to have 3 options: - if event has image, display that image - if event url title has a certain keyword, display that image - else display a placeholder image

I don’t know how to write the 2nd option to the existing code:

  {if event_photo}
    {exp:imgsizer:size src="{event_photo}” alt=”{title}” width=“300” height=“450” class=“displayBlock” quality=“100”}
  {if:else}
    /images/_pages/_global/placeholder.jpg
  {/if}
       
danklingjr's avatar
danklingjr
5 posts
11 years ago
danklingjr's avatar danklingjr

You can use a conditional to check if the url segment contains the keyword. Check out the docs here https://ellislab.com/expressionengine/user-guide/templates/conditionals.html#operators

       

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.