Skip to content

Commit

Permalink
[4.0] No Articles Message
Browse files Browse the repository at this point in the history
Both category blog and category list have an option to show or hide a message if there are no articles in the category.

Before this PR the option worked _only_ for a category blog. It was not possible to hide the message for a category list.

In addition the message, when displayed, was not formatted consistently. In some places it was a simple paragraph, in others it was a nicely formatted message. This PR makes the messages display consistently.
  • Loading branch information
brianteeman committed Oct 25, 2021
1 parent 49a0482 commit 8890935
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 4 additions & 3 deletions components/com_content/tmpl/category/blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@
<?php endif; ?>

<?php if (empty($this->lead_items) && empty($this->link_items) && empty($this->intro_items)) : ?>
<?php if ($this->params->get('show_no_articles', 1)) : ?>
<p><?php echo Text::_('COM_CONTENT_NO_ARTICLES'); ?></p>
<?php endif; ?>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('COM_CONTENT_NO_ARTICLES'); ?>
</div>
<?php endif; ?>

<?php $leadingcount = 0; ?>
Expand Down
10 changes: 6 additions & 4 deletions components/com_content/tmpl/category/default_articles.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,12 @@
<?php endif; ?>

<?php if (empty($this->items)) : ?>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('COM_CONTENT_NO_ARTICLES'); ?>
</div>
<?php if ($this->params->get('show_no_articles', 1)) : ?>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('COM_CONTENT_NO_ARTICLES'); ?>
</div>
<?php endif; ?>
<?php else : ?>
<table class="com-content-category__table category table table-striped table-bordered table-hover">
<caption class="visually-hidden">
Expand Down

0 comments on commit 8890935

Please sign in to comment.