blog 'read more' link

Options

Is there a method within a blog list template or the bodytype within that list to display just an excerpt of the content with a 'read more' link the the full article??

Tagged:

Comments

  • There is no built-in method to create a "read more" link, but it's pretty easy to implement.

    The first step is to decide if you want (need?) editorial control over the excerpt. If you do, then you should create a new custom property for your Blog Content Type, say "excerpt", and have the authors populate that appropriately. Then you would use the "excerpt" property in the list template and the "body" property in the single display template.

    If you are OK with programatically extracting the excerpt then you would want to do something like this in your List template:

    <t:list>

    <t:set id="excerpt" value="words(body, 80)"/>

    <p>${title} - ${excerpt}... <a href="${url}">read more</a></p>

    </t:list>

    Obviously, you'd want to put in the appropriate HTML to render the content to your liking, but this shows the basic idea.

Categories