GoodNewsGetNewsletters Snippet

What is GoodNewsGetNewsletters?

GoodNewsGetNewsletters is a Snippet to get a list of sent newsletters of the actual or a specified Mailing container. It's main purpose is to be used in conjunction with a GoodNews Mailing container to achieve a kind of newsletter archive (like a news archive).

How to use the Snippet

You need to place the GoodNewsNewsletters Snippet in the content area of the Mailing Container you like to get the newsletters listed.

Default properties for the Snippet

The GoodNewsGetNewsletters Snippet implements the following properties:

Property Description Default
parent The ID of a GoodNews Container. If set, newsletter Resources will be fetched from this container. The current Resource ID
tpl Name of a chunk serving as a newsletter Resource template. If not provided, properties are dumped to output for each resource. sample.GoodNewsNewsletterRowTpl
sortby Field to sort by for fetched Resources. publishedon
sortdir Sort direction for fetched Resources. DESC
includeContent Indicates if the content of each Resource should be returned in the results. 0=false
limit Limits the number of resources returned. Use 0 or leave empty for unlimited results. 10
offset An offset of resources returned by the criteria to skip. 0
totalVar The name of a placeholder indicating the total number of Resources that would be selected not considering the limit value. total
outputSeparator An optional string to separate each tpl instance. \n
toPlaceholder If set, will assign the result to this placeholder instead of outputting it directly.  

An example (minimal) GoodNewsGetNewsletters Snippet call would look like this:

[[GoodNewsGetNewsletters]]

GoodNewsGetNewsletters also comes with a default tpl Chunk sample.GoodNewsNewsletterRowTpl:

<div class="newsletterrow">
    <h3 class="newslettertitle"><a href="[[+url]]">[[+pagetitle]]</a></h3>
    [[+introtext:notempty=`
        <p class="newsletterintro">[[+introtext]]</p>
    `]]
</div>