joomla 4 blog category is not balanced correctly Topic is solved

For Joomla! 4.x Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Post Reply
hadichakery
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Sun May 20, 2018 1:48 pm

joomla 4 blog category is not balanced correctly

Post by hadichakery » Wed Oct 20, 2021 9:33 pm

I created a blog category from the menu.
In Joomla 4 -> In Blog Layout -> Columns ،
I can give a value to the column, but if we increase the value by one, the displayed contents are not balanced. And the "div" did not close properly. After a general search, I realized that the contents are arranged as follows : HTML :

Code: Select all


     <div class="blog-items">
         <div class="blog-item">
             <div class="content">1</div>
             <div class="blog-item">
                 <div class="content">2</div>
             </div>
             <div class="blog-item">
                 <div class="content">3</div>
                 <div class="blog-item">
                     <div class="content">4</div>
                     <div class="blog-item">
                          <div class="content">5</div>
                     </div>
                     <div class="blog-item">
                           <div class="content">6</div>         
                     </div>
                     <div class="blog-item">
                           <div class="content">7</div>
                     </div>
                 </div>
            </div>
        </div>
    </div>

it should be :

Code: Select all


<div class="blog-items">
     <div class="blog-item"><div class="content">1</div></div>
     <div class="blog-item"><div class="content">2</div></div>
     <div class="blog-item"><div class="content">3</div></div>
     <div class="blog-item"><div class="content">4</div></div>
     <div class="blog-item"><div class="content">5</div></div>         
     <div class="blog-item"><div class="content">6</div></div>
     <div class="blog-item"><div class="content">7</div></div>
</div>
Note: When I disable "loadTemplate", the loop is displayed correctly and the divisions are closed correctly. I also checked the information inside the "$this->loadTemplate('item')" but found no problem. PHP :

Code: Select all


<div class="blog-items">
    <?php foreach ($this->intro_items as $key => &$item) : ?>
        <div class="blog-item">
                <?php
                $this->item = & $item;
                echo $this->loadTemplate('item'); //Included <div class="content">value</div>
                ?>
        </div>
    <?php endforeach; ?>
</div>
How can this be balanced?
what is the problem?

Chakery
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Aug 11, 2016 11:59 am

Re: joomla 4 blog category is not balanced correctly

Post by Chakery » Sun Oct 24, 2021 11:21 am

:eek: it's true,fixed. :D
All content had a <div> tag before page break, :eek:
Little did I know that using <div> before page break can be so destructive, and I've been looking for problems with PHP code for about a week now.
This issue is expressed differently in this topic :
viewtopic.php?f=808&t=989462


Post Reply

Return to “Joomla! 4.x Coding”