Vertex
Vertex is a free responsive Joomla template, however the download will require a free membership. Vertex is built on Shape5 framework which offers 95 module positions, custom row and column width, and much more.
<a href="<?php echo $this->item->readmore_link; ?>" class="readon<?php echo $this->item->params->get('pageclass_sfx'); ?>">
<?php if ($this->item->readmore_register) :
echo JText::_('Register to read more...');
elseif ($readmore = $this->item->params->get('readmore')) :
echo $readmore;
else :
echo JText::sprintf('Read more...');
endif; ?></a>
echo JText::sprintf('Read more...');
echo JText::sprintf('Read more', $this->item->title);
<p class="readmore"><a class="btn" href="<?php echo $link; ?>"> <span class="icon-chevron-right"></span>
<?php if (!$params->get('access-view')) :
echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
elseif ($readmore = $this->item->alternative_readmore) :
echo $readmore;
if ($params->get('show_readmore_title', 0) != 0) :
echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
endif;
elseif ($params->get('show_readmore_title', 0) == 0) :
echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
else :
echo JText::_('COM_CONTENT_READ_MORE');
echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
endif; ?>
</a></p>
echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE', $this->item->title);
$this->item->created
. So we can use that date, compared to the current date, to see how old the article is. Then we can add a different CSS class for articles of different ages.<?php
/**
* Gets class based on today's date and article date
* @param $date
* @return string containing CSS class name
*/
class MyFrontpageHelper {
function MyFrontPageHelper() {
parent::_constructor();
}
function getCSSClassFromDate($date) {
$dateClass = ''; // default to blank
// subtract create date from current date. both dates in seconds
$elapsedDays = (time() - strtotime($date)) / 86400; // 86400=number of seconds per day
if ($elapsedDays <= 7) $dateClass = 'dateCurrent';
if (($elapsedDays > 7) && ($elapsedDays <= 14)) $dateClass = 'dateLastWeek';
if ($elapsedDays > 14) $dateClass = "dateOld";
return $dateClass;
}
}
?>
defined('_JEXEC') or die('Restricted access');
require_once('myfrontpagehelper.php');
require_once
statement. We need to use this (as opposed to the include
statement) because this code gets executed multiple times, once for each article. So therequire_once
statement makes sure we only include this file the first time.<?php if ($canEdit || $this->item->params->get('show_title') || $this->item->params->get('show_pdf_icon') || $this->item->params->get('show_print_icon') || $this->item->params->get('show_email_icon')) : ?>
<table class="contentpaneopen <?php echo MyFrontpageHelper::getCSSClassFromDate($this->item->created); ?>">
<table class="contentpaneopen dateCurrent">
<tr>
<td class="contentheading" width="100%">
Joomla! Security Strike Team </td>
.contentpaneopen.dateCurrent {
background: #F0FFFF;
}
.contentpaneopen.dateLastWeek {
background: #FFF8DC;
}
.contentpaneopen.dateOld {
background: #DCDCDC;
}
<?php echo $this->item->event->beforeDisplayContent; ?>
<table class="contentpaneopen <?php echo MyFrontpageHelper::getCSSClassFromDate($this->item->created); ?>">