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

Append/Prepend code if custom field contains data

Feature Requests

IC360 (Oliver Cannell)'s avatar
IC360 (Oliver Cannell)
241 posts
7 years ago
IC360 (Oliver Cannell)'s avatar IC360 (Oliver Cannell)

At the moment, to output a postal address, I might do something like this:

{property-address1}
{if property-address2}<br>{property-address2}{/if}
{if property-city}<br><strong>{property-city}</strong>{/if}
{if property-county}<br>{property-county}{/if}
{if property-postcode}<br><span class="red">{property-postcode}</span>{/if}

But I wonder if something like this would be more useful…?

{property-address1}
{property-address2 prepend="<br>"}
{property-city prepend="<br><strong>" append="</strong>"}
{property-county prepend="<br>"}
{property-postcode prepend="<br><span class="red">" append="</span>"}
       

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.