setState('list.limit', (int) $params->get('count', 0));
$articles->setState('load_tags', $params->get('show_tags', 0) || $params->get('article_grouping', 'none') === 'tags');
+ // Get the user object
+ $user = $app->getIdentity();
+
// Access filter
$access = !ComponentHelper::getParams('com_content')->get('show_noauth');
- $authorised = Access::getAuthorisedViewLevels($app->getIdentity()->get('id'));
+ $authorised = Access::getAuthorisedViewLevels($user->id);
$articles->setState('filter.access', $access);
$catids = $params->get('catid');
@@ -140,9 +143,17 @@ public function getArticles(Registry $params, SiteApplication $app)
// Filter by multiple tags
$articles->setState('filter.tag', $params->get('filter_tag', []));
+ // Filter by featured
$articles->setState('filter.featured', $params->get('show_featured', 'show'));
- $articles->setState('filter.author_id', $params->get('created_by', []));
- $articles->setState('filter.author_id.include', $params->get('author_filtering_type', 1));
+
+ // Filter by author
+ if ($params->get('author_filtering_type', 1) === 2) {
+ $articles->setState('filter.author_id', [$user->id]);
+ } else {
+ $articles->setState('filter.author_id', $params->get('created_by', []));
+ $articles->setState('filter.author_id.include', $params->get('author_filtering_type', 1));
+ }
+
$articles->setState('filter.author_alias', $params->get('created_by_alias', []));
$articles->setState('filter.author_alias.include', $params->get('author_alias_filtering_type', 1));
diff --git a/modules/mod_articles/tmpl/default.php b/modules/mod_articles/tmpl/default.php
index 1bbbc6a08e276..9aafe3b11f565 100644
--- a/modules/mod_articles/tmpl/default.php
+++ b/modules/mod_articles/tmpl/default.php
@@ -12,7 +12,6 @@
use Joomla\CMS\Helper\ModuleHelper;
use Joomla\CMS\Language\Text;
-use Joomla\String\StringHelper;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $app->getDocument()->getWebAssetManager();
@@ -37,14 +36,12 @@
$layoutSuffix = $params->get('title_only', 1) ? '_titles' : '_items';
?>
-
-
$items) : ?>
-
- <>>
- get('layout', 'default') . $layoutSuffix); ?>
-
+
+ <>>
+ get('layout', 'default') . $layoutSuffix); ?>
+