News:

Dear jDownloads users, There is currently no Joomla 6 compatible version available. However, we are working on it and hope to release it shortly.

Main Menu
Support-Forum

Location of the Document Tree Module in jDownloads 4.1

Started by ghicar, 26.03.2026 10:57:18

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

ghicar

This is a weird one and possibly more an issue with the 3rd party template in use.

I am using Joomlart T4 framework with T4-BS5-blank template. I have the site configured to show the jDownloads Document Tree module in a sidebar when the menu item component displayed is jDownloads "List of All Categories". The module starts off displayed by the side of the component on a desktop/laptop screen however if I move to a category that has subcategories the tree module moves below the component display. If I display a category that has no subcategories then it displays alongside.

This does NOT happen if I switch to the Cassiopaeia template and use its sidebar position.

This also does not happen in the 3rd party template if I use jDownloads 4.0.52.

Will investigate some more.
  •  

ghicar

It seems not related to jDownloads document tree. I have changed the sidebar to just display a simple module (any module will do) rather than document tree module and the problem remains. When displaying a category that has subcategiries something is forcing the template's mobile phone responsive layout to kick in and move the sidebar below the main component position.  This does not occur for "Overview (home)" view or any category with no sub categories.
  •  

ghicar

I've tracked the problem in 4.1.0 to file ~/components/com_jdownloads/tmpl/category/default.php.

At line 886
            if (!$use_legacy_pagination && preg_match('/<div[^>]*id="results"/', $cats_before)) {
                $body_subcats .= '</div>';
            }

This is adding a </div> when, in my case one wasn't added and this was messing up the page structure.  As a temporary fix I changed at line 664 from:

                } else {
                    // Fallback: add wrapper if no div found
                    $body_subcats .= '<div id="results">';
                }

To:
                } else {
                    // Fallback: add wrapper if no div found
                    $body_subcats .= '<div id="results">';
    $divAdded = true;
                }

and changed at line 884 to:
           //if (!$use_legacy_pagination && preg_match('/<div[^>]*id="results"/', $cats_before)) {
   if($divAdded) {
                $body_subcats .= '</div>';
            }


This has restored the sidebar back alongside the main component position.

Please consider/review the change for a future release.
  •  
    The following users thanked this post: Arno

Arno

Hi.
You are right, and thank you for tracking this down so precisely.

This is not actually specific to the Document Tree module itself.
The problem is caused by the category output in jDownloads 4.1.0 when subcategories are displayed.

We reviewed the code section you pointed to in default.php, and your analysis is essentially correct: in that code path an extra closing div could be added even when the corresponding wrapper was not really opened in that fallback case. That can break the page structure and cause the sidebar to drop below the main content in some templates/frameworks.

We have now adjusted this for the next build so that the wrapper is only closed when it was actually added by the fallback logic.

Thank you again for the very helpful report and for narrowing it down to the exact area in the template.

(Fixed in v4.1.1)
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •