Skip to content

Commit

Permalink
Update blog use Masonry
Browse files Browse the repository at this point in the history
  • Loading branch information
sonvnn committed Jul 31, 2024
1 parent df8782d commit dff131e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion framework/html/com_content/category/blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\Layout\LayoutHelper;
use Astroid\Framework;

$app = Factory::getApplication();

Expand All @@ -31,6 +32,13 @@

$htag = $this->params->get('show_page_heading') ? 'h2' : 'h1';

$use_masonry = $this->params->get('use_masonry', 0);

if ($use_masonry) {
$document = Framework::getDocument();
$document->loadMasonry();
}

?>
<div class="blog<?php echo $this->pageclass_sfx; ?>" itemscope itemtype="https://schema.org/Blog">
<?php if ($this->params->get('show_page_heading')) : ?>
Expand Down Expand Up @@ -109,7 +117,7 @@
<?php $blogClass .= ' row-cols-lg-'.$this->params->get('num_columns'); ?>
<?php endif; ?>
<div class="com-content-category-blog__items blog-items items-row">
<div class="row gx-xl-5 gy-5 <?php echo $blogClass; ?>">
<div class="row gx-xl-5 gy-5 <?php echo $blogClass; ?>"<?php echo $use_masonry ? ' data-masonry=\'{"percentPosition": true }\'' : ''; ?>>
<?php foreach ($this->intro_items as $key => &$item) : ?>
<div class="com-content-category-blog__item blog-item">
<?php
Expand Down

0 comments on commit dff131e

Please sign in to comment.