We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22827
    • 129 Posts
    Hello, all.

    This question has come up before, but not since Revolution I think, so I figured I would see how people are approaching this now.

    For blogs and rss feeds, you often want a summary or the first portion of the post to display on the listing page (or in the feed).

    The way I do this is to have a TV for the summary, and that either forms the first part of the full page - so it appears like this when displaying the whole post:
    [[*rtsummary]]
    [[*content]]
    


    Or the summary is a literal summary, and so the content editor needs to write both a summary and the content.

    Both of these approaches have drawbacks. Having the first paragraph or so in a TV and the rest in the content field can be unintuitive, particularly as the TVs are on a separate page (I haven’t figured out how to get them on the front page like MM did yet).

    Or the approach of having a summary that is only displayed as a summary and the main page is the "real" page means that content needs to be edited twice.

    So this isn’t purely a "how do I?" type question, I am curious how people are approaching this and what works best for the content editor?

    Cheers,

    Paul
      • 3749
      • 24,544 Posts
      I think the most logical method is to use the summary (introtext) field rather than a TV and display it with [[*introtext]]. In theory, you can use rich text for that field: http://modxcms.com/forums/index.php?topic=61472.0 (though I’ve never done it). That would make the process faster and more efficient, though it might prevent searches on the summary using getResources’ tvFilters.

      Either way, you can use an output modifier to show the introtext or rtsummary if it’s not empty and the first part of the content field if there’s nothing in the summary field.

      Personally, I think requiring the editor to create a summary that will work as the first paragraph of the content would be less workable than requiring the editor to create a real summary in addition to the article. The editor can always paste from the content to the summary field if that works for the particular article. YMMV.

      You might also look at the NewsPublisher snippet, which allows editing in the front end with TinyMCE. It will put everything on the same page and you can style the page to meet your needs.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting