? ? Pending

User tests: Successful: Unsuccessful:

avatar Denitz
Denitz
21 Feb 2022

Summary of Changes

Content, Contact and Newsfeeds components don't load Bootstrap collapse asset and expanding sub-categories is broken.

We need to load bootstrap.collapse asset like it's currently done for com_search/tmpl/default-form.php

Testing Instructions

Use any non-native template, i.e. Gantry.
See child sub-categories in com_content, com_contact and com_newsfeeds category view, click "plus" icon to expand sub-categories.

Actual result BEFORE applying this Pull Request

Nothing happens.

Expected result AFTER applying this Pull Request

Sub-categories are expanded.

Documentation Changes Required

No.

921026f 21 Feb 2022 avatar Denitz start
avatar Denitz Denitz - open - 21 Feb 2022
avatar Denitz Denitz - change - 21 Feb 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 21 Feb 2022
Category Front End com_contact com_content com_newsfeeds
avatar brianteeman
brianteeman - comment - 21 Feb 2022

This can not be correct. See

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('com_categories');
$wa->useScript('com_categories.shared-categories-accordion');

"assets": [
{
"name": "com_categories.shared-categories-accordion",
"type": "preset",
"dependencies": [
"com_categories.shared-categories-accordion#style",
"com_categories.shared-categories-accordion#script"
]

https://github.com/joomla/joomla-cms/blob/4.1-dev/build/media_source/com_categories/js/shared-categories-accordion.es6.js

avatar Denitz
Denitz - comment - 21 Feb 2022

OK, but where Bootstrap Collapse is loaded?

avatar brianteeman
brianteeman - comment - 21 Feb 2022

it isnt because it is using a different script as shown

avatar joomdonation
joomdonation - comment - 21 Feb 2022

@Denitz As Brian pointed out, we use our own accordion script. If I remember correctly, all you need to do is using the same code which we are having in com_content https://github.com/joomla/joomla-cms/blob/4.1-dev/components/com_content/tmpl/categories/default_items.php#L35-L44 for these components and it will work as expected.

faaede6 22 Feb 2022 avatar Denitz fix
avatar Denitz Denitz - change - 22 Feb 2022
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 22 Feb 2022
Category Front End com_contact com_content com_newsfeeds Front End com_content
avatar Denitz
Denitz - comment - 22 Feb 2022

@brianteeman Yes, you are right! Actually
components/com_content/tmpl/categories/default_items.php
components/com_contact/tmpl/categories/default_items.php
components/com_newsfeeds/tmpl/categories/default_items.php
uses <button id=category-btn-.. with com_categories.shared-categories-accordion script.
No changes here.

But
components/com_content/tmpl/category/blog_children.php
components/com_content/tmpl/category/default_children.php
use <a data-bs-toggle="collapse"... without HTMLHelper::_('bootstrap.collapse') , I added Bootstrap script load.

Or we should re-build these two layouts in components/com_content/tmpl/category to use <button id=category-btn-.. with com_categories.shared-categories-accordion script?

avatar drmenzelit
drmenzelit - comment - 5 May 2022

Hi @Denitz, sorry for taking so long to answer you question. The correct way should be to change the code in the views to remove bootstrap collapse and use Joomla's own accordion script. It would be great if you can rebase to 4.2 and modify the PR correspondly.

avatar Denitz Denitz - change - 8 Jun 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-06-08 05:31:54
Closed_By Denitz
Labels Added: ?
avatar Denitz Denitz - close - 8 Jun 2022

Add a Comment

Login with GitHub to post a comment