Created
February 1, 2010 00:03
-
-
Save newism/291327 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{!-- | |
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 …</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