From 0739dab6ac78c8334c5b2d6f02faf2be0fac5b5e Mon Sep 17 00:00:00 2001 From: Sonny Le Date: Wed, 17 Jan 2024 12:29:30 +0700 Subject: [PATCH] Fixed issue WCAG compatible. Finish Article Widget --- .../astroid/scss/widgets/_articles.scss | 9 ++++ .../vendor/astroid/scss/widgets/_widgets.scss | 3 +- framework/elements/articles/articles.php | 47 +++++++++++++++---- framework/elements/articles/articles.xml | 5 +- framework/frontend/blog/audio.php | 4 +- framework/frontend/blog/modules/related.php | 17 ++++--- framework/frontend/header/horizontal.php | 2 +- framework/frontend/header/sidebar.php | 2 +- framework/frontend/header/stacked.php | 10 ++-- framework/frontend/header/sticky.php | 2 +- framework/frontend/mobilemenu.php | 2 +- framework/frontend/offcanvas/close.php | 2 +- framework/frontend/offcanvas/trigger.php | 2 +- 13 files changed, 71 insertions(+), 36 deletions(-) create mode 100644 assets/vendor/astroid/scss/widgets/_articles.scss diff --git a/assets/vendor/astroid/scss/widgets/_articles.scss b/assets/vendor/astroid/scss/widgets/_articles.scss new file mode 100644 index 00000000..a48ea488 --- /dev/null +++ b/assets/vendor/astroid/scss/widgets/_articles.scss @@ -0,0 +1,9 @@ +.astroid-articles { + .astroid-article-info { + font-size: 0.895rem; + opacity: 0.7; + dd { + margin-bottom: 0; + } + } +} \ No newline at end of file diff --git a/assets/vendor/astroid/scss/widgets/_widgets.scss b/assets/vendor/astroid/scss/widgets/_widgets.scss index 49ef3f5d..68d30d98 100644 --- a/assets/vendor/astroid/scss/widgets/_widgets.scss +++ b/assets/vendor/astroid/scss/widgets/_widgets.scss @@ -1,2 +1,3 @@ @import "grid"; -@import "video_button"; \ No newline at end of file +@import "video_button"; +@import "articles"; \ No newline at end of file diff --git a/framework/elements/articles/articles.php b/framework/elements/articles/articles.php index 30caa052..091a531a 100644 --- a/framework/elements/articles/articles.php +++ b/framework/elements/articles/articles.php @@ -16,7 +16,11 @@ use Astroid\Helper\Style; use Astroid\Component\Article; use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\Component\Content\Site\Helper\RouteHelper; extract($displayData); $catids = json_decode($params->get('catids', '[]'), true); @@ -109,23 +113,31 @@ Style::renderTypography('#'.$element->id.' .astroid-article-introtext', $content_font_style); } +$readmore = $params->get('enable_readmore', 0); +$button_style = $params->get('button_style', 'primary'); $button_size = $params->get('button_size', ''); $button_size = $button_size ? ' '. $button_size : ''; +$button_outline = $params->get('button_outline', 0); +$button_radius = $params->get('button_border_radius', ''); +$button_radius = $button_radius ? ' ' . $button_radius : ''; -$mainframe = Factory::getApplication(); -$wa = $mainframe->getDocument()->getWebAssetManager(); -$wa->useScript('bootstrap.carousel'); +$has_gallery = false; echo '
'; foreach ($items as $key => $item) { + $link = RouteHelper::getArticleRoute($item->slug, $item->catid, $item->language); $media = ''; switch ($item->post_format) { case 'regular': - $media = ''.$item->title.''; + case 'review': + if (!empty($item->image_thumbnail)) { + $media = ''.$item->title.''; + } break; case 'gallery': $gallery = (array) $item->params->get('astroid_article_gallery_items', array()); if (count($gallery)) { - $media .= '