Templates
The newsletter template editor, the preview with archive content, and the variables of the article loop. How it differs from the push syntax.
Updated on
The Templates tab is where you edit the HTML of newsletter issues. The Novo template (new template) editor has two columns: on the left, the Código HTML (HTML code) field and the Atualizar prévia (refresh preview) button; on the right, the preview rendered with articles from the archive. The Salvar (save) button sits in the header.
Variables
The editor footer lists the available variables: @foreach $pages, $page->page_title, $page->page_description, $page->page_url, and $page->page_image. The @foreach ($pages as $page) loop iterates over the articles in the issue, and each field is written between double braces.
@foreach ($pages as $page)
<article>
<a href="{{ $page->page_url }}"><img src="{{ $page->page_image }}" alt=""></a>
<h2><a href="{{ $page->page_url }}">{{ $page->page_title }}</a></h2>
<p>{{ $page->page_description }}</p>
</article>
@endforeachWhat sits outside the loop appears once per issue. What sits inside the loop repeats for each article.
Template and push
| Field | Push | Newsletter |
|---|---|---|
| Title | {page_title} | {{ $page->page_title }} |
| Description | {page_description} | {{ $page->page_description }} |
| URL | {page_url} | {{ $page->page_url }} |
| Image | {page_image} | {{ $page->page_image }} |
The syntaxes differ because push sends one article and the newsletter builds a list. Use the preview to check: if an article title appears in the right column, the variable is correct; if the variable text appears literally, the syntax used belongs to the other module.