Created
January 21, 2014 19:16
-
-
Save xcommerce-gists/8546370 to your computer and use it in GitHub Desktop.
Sample Magento template for the news article list view
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* News template for items list | |
* | |
* @author Magento | |
*/ | |
/** | |
* @var $this Magentostudy_News_Block_List | |
* @see Magentostudy_News_Block_List | |
*/ | |
?> | |
<div id="news_list_messages"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div> | |
<div class="page-title"> | |
<h1><?php echo Mage::helper('magentostudy_news')->__('Site News') ?></h1> | |
</div> | |
<div class="news_list_view"> | |
<?php foreach ($this->getCollection() as $newsItem): ?> | |
<div id="item_<?php echo $newsItem->getId() ?>" class="news_list_item"> | |
<h2> | |
<a href="<?php echo $this->getItemUrl($newsItem) ?>"> | |
<?php echo $this->escapeHtml($newsItem->getTitle()) ?> | |
</a> | |
</h2> | |
<div class="news_item_subtitle"> | |
<?php echo $this->formatDate($newsItem->getTimePublished(), 'medium') ?> | | |
<?php echo $this->escapeHtml($newsItem->getAuthor()) ?> | |
</div> | |
<?php if ($imageUrl = $this->getImageUrl($newsItem, 100)): ?> | |
<p><img src="<?php echo $imageUrl ?>" alt="<?php echo $this->escapeHtml($newsItem->getTitle()); ?>" /></p> | |
<?php endif; ?> | |
</div> | |
<?php endforeach; ?> | |
</div> | |
<?php echo $this->getPager() ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment