Skip to content

Instantly share code, notes, and snippets.

@newism
Created February 1, 2010 00:03
Show Gist options
  • Save newism/291327 to your computer and use it in GitHub Desktop.
Save newism/291327 to your computer and use it in GitHub Desktop.
{!--
Add this to your index page.
Returns the content before <!-- #more --> including the replacement
The idea is you can use a comment in a single custom field and only return a sub-section.
find="" accepts a regular expression which allows you to add <!-- #more --> inside a paragraph block.
--}
{exp:nsm_content_split:split find="#<!-- #more -->(<\p>)?#"}
{replace_with}<a href="{comment_url_title}">More &hellip;</a>$1{/replace_with}
{news_content}
{exp:nsm_content_split:split}
{!--
Add this to your entry details page
Replaces <!-- #more --> with an anchor you can target from the index page
--}
{exp:nsm_content_split:add_anchor find="<!-- #more -->"}
{replace_with}<a name="#more" />{/replace_with}
{news_content}
{/exp:nsm_content_split:add_anchor}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment