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

Replacing ’\n’

Development and Programming

davenport's avatar
davenport
67 posts
16 years ago
davenport's avatar davenport

http://www.qualitybuildings.biz/showcase/view/horse_barns

For the subcategory page I use exp:list_maker to format the category_description into a <ul>, but on the page above I want a snippet of that description separated by commas.

Why does the following not work?

{if cat_description}{exp:char_limit total="55"}{exp:replace casesensitive="no" find="\\n" replace=", "}{cat_description}{/exp:replace}{/exp:char_limit}{if:else}No description provided.{/if}

I also tried:

{exp:replace parse="inward" casesensitive="no" find="\\r\\n" replace=", "}
{exp:replace casesensitive="no" find="\\r" replace=", "}
{exp:replace regex="yes" find="^\\r?\\n" replace=", "}

Moved to Plugins by Moderator

       
davenport's avatar
davenport
67 posts
16 years ago
davenport's avatar davenport

If you look in the source code, there is a line break between “roof” and “Sturdy”…

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
16 years ago
Sue Crocker's avatar Sue Crocker

exp:replace is a third party plugin, I’m going to move this to the Plugins forum for additional community involvement.

       

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.