Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap accordion not working #3263

Open
lipatovroman opened this issue Aug 9, 2024 · 5 comments
Open

Bootstrap accordion not working #3263

lipatovroman opened this issue Aug 9, 2024 · 5 comments

Comments

@lipatovroman
Copy link

lipatovroman commented Aug 9, 2024

Hello.
I installed clean Joomla 4.4.6 and latest Gantry 5 + Helium template.
Then I inserted accordion code from Bootstrap 5 example from this page https://getbootstrap.com/docs/5.0/components/accordion/

The code doesn't work. The button doesn't work.

@pablop76
Copy link

pablop76 commented Aug 16, 2024

Joomla 4 Introduces a Modular Approach for Interactive Components
https://docs.joomla.org/J4.x:Using_Bootstrap_Components_in_Joomla_4

@lipatovroman
Copy link
Author

Joomla 4 Introduces a Modular Approach for Interactive Components https://docs.joomla.org/J4.x:Using_Bootstrap_Components_in_Joomla_4

Ok. I added the code
\Joomla\CMS\HTML\HTMLHelper::_('bootstrap.collapse', '.selector', []);
To FlexiContent template and now it works.

But how to add this code in Gantry5 template?
Maybe we need PHP atom or particle?

@pablop76
Copy link

pablop76 commented Aug 31, 2024

If you are using Gantry you can add bootstrap in a basic outline for the entire site or a dedicated outline, page settings tab -> Head Properties -> Custom Content

@lipatovroman
Copy link
Author

Is it ok?
2024-08-31 17-03-12

@pablop76
Copy link

pablop76 commented Sep 1, 2024

You probably need to return the link from the cdn.
https://getbootstrap.com/docs/4.0/getting-started/introduction/
or from your joomla you will find in
media/vendor/bootstrap

for example

<script src="/media/vendor/bootstrap/js/collapse.min.js" type="module"></script>

You can use this plugin and create a suitable module and publish it to gantry using the module instance particle
https://github.com/ceford/j4xdemos-mod-custom-bscompos/raw/master/mod_custom_bscompos.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants