Skip to content

Commit

Permalink
[5.3] Archive Content - layouts (#44601)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianteeman authored Jan 10, 2025
1 parent 92835a9 commit bb33b84
Showing 1 changed file with 4 additions and 177 deletions.
181 changes: 4 additions & 177 deletions components/com_content/tmpl/archive/default_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
defined('_JEXEC') or die;

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Content\Site\Helper\RouteHelper;

Expand All @@ -36,105 +36,11 @@
<?php // Content is generated by content plugin event "onContentAfterTitle" ?>
<?php echo $item->event->afterDisplayTitle; ?>

<?php if ($params->get('show_author') && !empty($item->author)) : ?>
<div class="createdby">
<?php $author = $item->created_by_alias ?: $item->author; ?>
<?php $author = '<span>' . $author . '</span>'; ?>
<?php if (!empty($item->contact_link) && $params->get('link_author') == true) : ?>
<?php echo Text::sprintf('COM_CONTENT_WRITTEN_BY', HTMLHelper::_('link', $this->item->contact_link, $author, ['itemprop' => 'url'])); ?>
<?php else : ?>
<?php echo Text::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date')
|| $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category')); ?>
<?php if ($useDefList && ($info == 0 || $info == 2)) : ?>
<div class="com-content-archive__info article-info text-muted">
<dl class="article-info">
<dt class="article-info-term">
<?php echo Text::_('COM_CONTENT_ARTICLE_INFO'); ?>
</dt>

<?php if ($params->get('show_parent_category') && !empty($item->parent_id)) : ?>
<dd>
<div class="parent-category-name">
<?php $title = $this->escape($item->parent_title); ?>
<?php if ($params->get('link_parent_category') && !empty($item->parent_id)) : ?>
<?php $url = '<a href="' . Route::_(
RouteHelper::getCategoryRoute($item->parent_id, $item->parent_language)
)
. '">' . $title . '</a>'; ?>
<?php echo Text::sprintf('COM_CONTENT_PARENT', $url); ?>
<?php else : ?>
<?php echo Text::sprintf('COM_CONTENT_PARENT', '<span>' . $title . '</span>'); ?>
<?php endif; ?>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_category')) : ?>
<dd>
<div class="category-name">
<?php $title = $this->escape($item->category_title); ?>
<?php if ($params->get('link_category') && $item->catid) : ?>
<?php $url = '<a href="' . Route::_(
RouteHelper::getCategoryRoute($item->catid, $item->category_language)
)
. '">' . $title . '</a>'; ?>
<?php echo Text::sprintf('COM_CONTENT_CATEGORY', $url); ?>
<?php else : ?>
<?php echo Text::sprintf('COM_CONTENT_CATEGORY', '<span>' . $title . '</span>'); ?>
<?php endif; ?>
</div>
</dd>
<?php endif; ?>

<?php if ($params->get('show_publish_date')) : ?>
<dd>
<div class="published">
<span class="icon-calendar-alt" aria-hidden="true"></span>
<time datetime="<?php echo HTMLHelper::_('date', $item->publish_up, 'c'); ?>">
<?php echo Text::sprintf('COM_CONTENT_PUBLISHED_DATE_ON', HTMLHelper::_('date', $item->publish_up, Text::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>

<?php if ($info == 0) : ?>
<?php if ($params->get('show_modify_date')) : ?>
<dd>
<div class="modified">
<span class="icon-calendar-alt" aria-hidden="true"></span>
<time datetime="<?php echo HTMLHelper::_('date', $item->modified, 'c'); ?>">
<?php echo Text::sprintf('COM_CONTENT_LAST_UPDATED', HTMLHelper::_('date', $item->modified, Text::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_create_date')) : ?>
<dd>
<div class="create">
<span class="icon-calendar-alt" aria-hidden="true"></span>
<time datetime="<?php echo HTMLHelper::_('date', $item->created, 'c'); ?>">
<?php echo Text::sprintf('COM_CONTENT_CREATED_DATE_ON', HTMLHelper::_('date', $item->created, Text::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>

<?php if ($params->get('show_hits')) : ?>
<dd>
<div class="hits">
<span class="icon-eye"></span>
<meta content="UserPageVisits:<?php echo $item->hits; ?>">
<?php echo Text::sprintf('COM_CONTENT_ARTICLE_HITS', $item->hits); ?>
</div>
</dd>
<?php endif; ?>
<?php endif; ?>
</dl>
</div>
<?php echo LayoutHelper::render('joomla.content.info_block', ['item' => $item, 'params' => $params, 'position' => 'above']); ?>
<?php endif; ?>

<?php // Content is generated by content plugin event "onContentBeforeDisplay" ?>
Expand All @@ -144,90 +50,11 @@
<?php endif; ?>

<?php if ($useDefList && ($info == 1 || $info == 2)) : ?>
<div class="article-info text-muted">
<dl class="article-info">
<dt class="article-info-term"><?php echo Text::_('COM_CONTENT_ARTICLE_INFO'); ?></dt>

<?php if ($info == 1) : ?>
<?php if ($params->get('show_parent_category') && !empty($item->parent_id)) : ?>
<dd>
<div class="parent-category-name">
<?php $title = $this->escape($item->parent_title); ?>
<?php if ($params->get('link_parent_category') && $item->parent_id) : ?>
<?php $url = '<a href="' . Route::_(
RouteHelper::getCategoryRoute($item->parent_id, $item->parent_language)
)
. '">' . $title . '</a>'; ?>
<?php echo Text::sprintf('COM_CONTENT_PARENT', $url); ?>
<?php else : ?>
<?php echo Text::sprintf('COM_CONTENT_PARENT', '<span>' . $title . '</span>'); ?>
<?php endif; ?>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_category')) : ?>
<dd>
<div class="category-name">
<?php $title = $this->escape($item->category_title); ?>
<?php if ($params->get('link_category') && $item->catid) : ?>
<?php $url = '<a href="' . Route::_(
RouteHelper::getCategoryRoute($item->catid, $item->category_language)
)
. '">' . $title . '</a>'; ?>
<?php echo Text::sprintf('COM_CONTENT_CATEGORY', $url); ?>
<?php else : ?>
<?php echo Text::sprintf('COM_CONTENT_CATEGORY', '<span>' . $title . '</span>'); ?>
<?php endif; ?>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_publish_date')) : ?>
<dd>
<div class="published">
<span class="icon-calendar-alt" aria-hidden="true"></span>
<time datetime="<?php echo HTMLHelper::_('date', $item->publish_up, 'c'); ?>">
<?php echo Text::sprintf('COM_CONTENT_PUBLISHED_DATE_ON', HTMLHelper::_('date', $item->publish_up, Text::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php endif; ?>

<?php if ($params->get('show_create_date')) : ?>
<dd>
<div class="create">
<span class="icon-calendar-alt" aria-hidden="true"></span>
<time datetime="<?php echo HTMLHelper::_('date', $item->created, 'c'); ?>">
<?php echo Text::sprintf('COM_CONTENT_CREATED_DATE_ON', HTMLHelper::_('date', $item->modified, Text::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_modify_date')) : ?>
<dd>
<div class="modified">
<span class="icon-calendar-alt" aria-hidden="true"></span>
<time datetime="<?php echo HTMLHelper::_('date', $item->modified, 'c'); ?>">
<?php echo Text::sprintf('COM_CONTENT_LAST_UPDATED', HTMLHelper::_('date', $item->modified, Text::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_hits')) : ?>
<dd>
<div class="hits">
<span class="icon-eye"></span>
<meta content="UserPageVisits:<?php echo $item->hits; ?>">
<?php echo Text::sprintf('COM_CONTENT_ARTICLE_HITS', $item->hits); ?>
</div>
</dd>
<?php endif; ?>
</dl>
</div>
<?php echo LayoutHelper::render('joomla.content.info_block', ['item' => $item, 'params' => $params, 'position' => 'below']); ?>
<?php endif; ?>
<?php // Content is generated by content plugin event "onContentAfterDisplay" ?>
<?php echo $item->event->afterDisplayContent; ?>
</div>
</div>
<?php endforeach; ?>
</div>
<div class="com-content-archive__navigation w-100">
Expand Down

0 comments on commit bb33b84

Please sign in to comment.