You are here

simplenews-newsletter-body.tpl.php in Simplenews 7.2

Default theme implementation to format the simplenews newsletter body.

Copy this file in your theme directory to create a custom themed body. Rename it to override it. Available templates: simplenews-newsletter-body--[tid].tpl.php simplenews-newsletter-body--[view mode].tpl.php simplenews-newsletter-body--[tid]--[view mode].tpl.php See README.txt for more details.

Available variables:

  • $build: Array as expected by render()
  • $build['#node']: The $node object
  • $title: Node title
  • $language: Language code
  • $view_mode: Active view mode
  • $simplenews_theme: Contains the path to the configured mail theme.
  • $simplenews_subscriber: The subscriber for which the newsletter is built. Note that depending on the used caching strategy, the generated body might be used for multiple subscribers. If you created personalized newsletters and can't use tokens for that, make sure to disable caching or write a custom caching strategy implemention.

File

theme/simplenews-newsletter-body.tpl.php
View source
<?php

/**
 * @file
 * Default theme implementation to format the simplenews newsletter body.
 *
 * Copy this file in your theme directory to create a custom themed body.
 * Rename it to override it. Available templates:
 *   simplenews-newsletter-body--[tid].tpl.php
 *   simplenews-newsletter-body--[view mode].tpl.php
 *   simplenews-newsletter-body--[tid]--[view mode].tpl.php
 * See README.txt for more details.
 *
 * Available variables:
 * - $build: Array as expected by render()
 * - $build['#node']: The $node object
 * - $title: Node title
 * - $language: Language code
 * - $view_mode: Active view mode
 * - $simplenews_theme: Contains the path to the configured mail theme.
 * - $simplenews_subscriber: The subscriber for which the newsletter is built.
 *   Note that depending on the used caching strategy, the generated body might
 *   be used for multiple subscribers. If you created personalized newsletters
 *   and can't use tokens for that, make sure to disable caching or write a
 *   custom caching strategy implemention.
 *
 * @see template_preprocess_simplenews_newsletter_body()
 */
?>
<h2><?php

print $title;
?></h2>
<?php

print render($build);