1

As I'm not quite happy with the Simplenews module I want to use phplist instead. The newsletter should contain the teasers of the articles I want to send. Is there a way to export specific articles teasers to HTML (using a custom template), so that I don't have to copy and paste every single teaser to my newsletter?

1 Answer 1

1

If you want to make a View of node teasers, all you have to do is set the view format to Rendered Content, and select the teaser display mode.

From here, you can customize node--node-type--teaser.html.twig template to your exact specifications to satisfy phplist.

After this change, all the nodes that the View returns will be rendered in the teaser display mode using that template.

You can also create new modes under Admin > Structure > Display Modes if you want to create new ones for this purpose, especially if you are already using teaser display mode elsewhere on the site. You can still provide the markup and theme it with the pattern node--node-type--display-mode.html.twig.

If for some reason this is not enough, you may have to resort to creating a custom Views plugin to render your result rows. I think this should suffice based on what you asked, though.

2
  • Ok, this sounds reasonable, thank you! This is a bit off-topic, but is there a way to limit the outputted teasers in views to a specific time range?
    – 0711master
    Feb 23, 2017 at 16:00
  • I guess you would add a filter to the view for the created date.
    – Kevin
    Feb 23, 2017 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.