announcements-feed.tpl.php
Template file for the theming of announcements_feed admin page.
Available variables:
- $count: Contains the total number of announcements.
- $featured: An array of featured announcements.
- $standard: An array of non-featured announcements.
Each $announcement in $featured and $standard contain:
- $announcement['id']: Unique id of the announcement.
- $announcement['title']: Title of the announcement.
- $announcement['teaser']: Short description of the announcement.
- $announcement['link']: Learn more link of the announcement.
- $announcement['date_published']: Timestamp of the announcement.
See also
1 theme call to announcements-feed.tpl.php
- announcements_feed_get_announcements in modules/
announcements_feed/ announcements_feed.inc - Returns the list of announcements.
File
-
modules/
announcements_feed/ announcements-feed.tpl.php
View source
<?php
/**
* @file
* Template file for the theming of announcements_feed admin page.
*
* Available variables:
* - $count: Contains the total number of announcements.
* - $featured: An array of featured announcements.
* - $standard: An array of non-featured announcements.
*
* Each $announcement in $featured and $standard contain:
* - $announcement['id']: Unique id of the announcement.
* - $announcement['title']: Title of the announcement.
* - $announcement['teaser']: Short description of the announcement.
* - $announcement['link']: Learn more link of the announcement.
* - $announcement['date_published']: Timestamp of the announcement.
*
* @see announcements_feed_theme()
*
* @ingroup themeable
*/
if ($count) {
?>
<div class="announcements">
<ul class="admin-list">
<?php
if ($featured) {
?>
<div class="featured-announcements-wrapper">
<?php
foreach ($featured as $key => $announcement) {
?>
<li class="leaf">
<div class="announcement-title">
<h4>
<?php
print $announcement['title'];
?>
</h4>
</div>
<div class="announcement-teaser">
<?php
print strip_tags($announcement['teaser']);
?>
</div>
<div class="announcement-link">
<?php
if ($announcement['link']) {
?>
<a target="_blank" href="<?php
print $announcement['link'];
?>">
<span>
<?php
print t('Learn More');
?>
</span>
</a>
<?php
}
?>
</div>
</li>
<?php
}
?>
</div>
<?php
}
?>
<?php
if ($standard) {
?>
<?php
foreach ($standard as $key => $announcement) {
?>
<li class="leaf">
<a target="_blank" href="<?php
print $announcement['link'];
?>"><?php
print $announcement['title'];
?></a>
<div class="description">
<?php
print format_date(strtotime($announcement['date_published']), 'short');
?>
</div>
</li>
<?php
}
?>
<?php
}
?>
</ul>
<?php
if ($feed_link) {
?>
<div class="announcements--view-all">
<a target="_blank" href="<?php
print $feed_link;
?>"><?php
print t('View all announcements');
?></a>
</div>
<?php
}
?>
</div>
<?php
}
else {
?>
<div class="no-announcements"><span><?php
print t('No announcements available');
?></span></div>
<?php
}
Related topics
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.