3

Content “split” with search/replace


Avatar
iantresman

Custom Content Shortcode has a “split” feature to get different parts of a string based on the nth occurrence of a specified character. It would be nice to have the same option in Loops & Logic, but enhanced to:

Extract a substring, eg. [string, start, end]
Option to start selection from the start or end of the string, or nth character
Option to omit end of string (ie to the rest of the string)
Option to replace/concatonate substring with text
Regex option

I think there are some good examples in several programming languages to base this on, and make it as flexible as it can be in L&L.

I know this could be done in PHP, but not everyone is comfortable with it.

A

Activity Newest / Oldest

Avatar

Tangible Plugins

Status changed to: Planned

Avatar

Benjamin

I'm not super familiar with the capabilities of CCS's "split" feature or its equivalent in PHP, but I could imagine using this in L&L to format in order to generate a table of contents dynamically or to create an automatic excerpt based on the post content that was able to more intelligently show the full first paragraph instead of the current tools that just limit the auto-excerpt to displaying a certain number of characters. Hopefully this use case is helpful for whoever adds this feature to L&L.