Bootstrap 5 dropdown menu in Joomla 4

Everything to do with Joomla! 4.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
User avatar
Gasoline
Joomla! Explorer
Joomla! Explorer
Posts: 424
Joined: Tue Aug 23, 2005 10:33 am
Location: NL

Bootstrap 5 dropdown menu in Joomla 4

Post by Gasoline » Sun Sep 26, 2021 8:09 am

I can't see how to implement this is my template.

Anybody knows which code I should place in my template and probably which overrides I should use?

I have added BS5 and fontawesome from Joomla 4 in my template.
Using Joomla since 2005

User avatar
Pavel-ww
Joomla! Explorer
Joomla! Explorer
Posts: 450
Joined: Tue Jun 30, 2020 12:17 pm

Re: Bootstrap 5 dropdown menu in Joomla 4

Post by Pavel-ww » Sun Sep 26, 2021 8:31 am

Gasoline wrote:
Sun Sep 26, 2021 8:09 am
I can't see how to implement this is my template.

Anybody knows which code I should place in my template and probably which overrides I should use?

I have added BS5 and fontawesome from Joomla 4 in my template.
Hi. If before interactive components from BS 4 were used in your template you need to change the data attributes in all interactive components from data-xxxxx to data-bs-xxxxx.

Also, make sure that in your template include bootstrap.bundle.min.js

organicwebs
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Oct 13, 2021 7:00 am

Re: Bootstrap 5 dropdown menu in Joomla 4

Post by organicwebs » Wed Oct 13, 2021 7:09 am

How did you go with this?

I had to write overrides to mod_menu in my template/html folder to adapt Joomla 4 so it use the correct classes for Bootstrap 5.

They are not perfect... I'm fixing it as I need - but I can send them to you.


I don't understand why Joomla says it is bootstrap 5 compatible - when it doesn't actually use it with it's native code or default components? Is there something I'm missing???

organicwebs
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Oct 13, 2021 7:00 am

Re: Bootstrap 5 dropdown menu in Joomla 4

Post by organicwebs » Wed Oct 13, 2021 7:25 am

Using overides...

In templates/[my_template]/html/mod_menu folder, create this default.php file

(It's not perfect - just a start at getting Bootstrap5 text menus and dropdowns working....)

Code: Select all

<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_menu
 //
 // OrganicWebs modified - Oct 2021
 *
 * @copyright   (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Helper\ModuleHelper;

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $app->getDocument()->getWebAssetManager();
$wa->registerAndUseScript('mod_menu', 'mod_menu/menu.min.js', [], ['type' => 'module']);
$wa->registerAndUseScript('mod_menu', 'mod_menu/menu-es5.min.js', [], ['nomodule' => true, 'defer' => true]);

$id = '';

if ($tagId = $params->get('tag_id', ''))
{
	$id = ' id="' . $tagId . '"';
}

// The menu class is deprecated. Use mod-menu instead
?>
<ul<?php echo $id; ?> class="navbar-nav <?php echo $class_sfx; ?>">
<?php foreach ($list as $i => &$item){
	// Define the <li> class...
	$itemParams = $item->getParams();
	$class      = 'nav-item item-' . $item->id;

	if ($item->id == $default_id)
	{
		$class .= ' default';
	}

	if ($item->id == $active_id || ($item->type === 'alias' && $itemParams->get('aliasoptions') == $active_id))
	{
		$class .= ' current';
	}

	if (in_array($item->id, $path))
	{
		$class .= ' active';
	}
	elseif ($item->type === 'alias')
	{
		$aliasToId = $itemParams->get('aliasoptions');

		if (count($path) > 0 && $aliasToId == $path[count($path) - 1])
		{
			$class .= ' active';
		}
		elseif (in_array($aliasToId, $path))
		{
			$class .= ' alias-parent-active';
		}
	}

	if ($item->type === 'separator')
	{
		$class .= ' divider';
	}

	if ($item->deeper)
	{
//		$class .= ' deeper '; Old
		$class .= ' dropdown '; // OrganicWebs Bootstrap 5 
	}

	if ($item->parent)
	{
//		$class .= ' parent';	// OLD - not used in Bootstrap 5
	}

	######################
	// Print the <li> tag

	echo '<li class="' . $class . '">';

	switch ($item->type) :
		case 'separator':
		case 'component':
		case 'heading':
		case 'url':  // Formatting the <a> tag
//			require ModuleHelper::getLayoutPath('mod_menu', 'default_' . $item->type); // Old Joomla Menu
//			echo "<pre>".print_r ($item,1)."</pre>"; // Debug
			$a_class = $itemParams->get('menu-anchor_css'); 	// OrganicWebs Bootstrap 5		
			if ($item->current) $a_class .= " active"; 			// OrganicWebs Bootstrap 5	
			
			if ($item->parent) {
				// Dropdown Parent menu
				echo "<a class='nav-link dropdown-toggle' href='#' role='button' data-bs-toggle='dropdown' aria-expanded='false'> $item->title</a>"; // OrganicWebs Bootstrap 5
			}
			elseif ($item->level > 1) {
				// Menu Link in a dropdown	
				echo "<a class='dropdown-item $a_class ' href='/$item->route' > $item->title </a>"; // OrganicWebs Bootstrap 5 
			}
			else {
				// Standard Menu Link
				echo "<a class='nav-link $a_class ' href='/$item->route' > $item->title </a>"; // OrganicWebs Bootstrap 5 
			}
			break;

		default:
			require ModuleHelper::getLayoutPath('mod_menu', 'default_url');
			break;
	endswitch;

	// The next item is deeper.
	if ($item->deeper)
	{
//		echo '<ul class="mod-menu__sub list-unstyled small">';  // OLD
		echo '<ul class="dropdown-menu" aria-labelledby="navbarDropdown">';  // OrganicWebs Bootstrap 5
	}
	// The next item is shallower.
	elseif ($item->shallower)
	{
		echo '</li>';
		echo str_repeat('</ul></li>', $item->level_diff);
	}
	// The next item is on the same level.
	else
	{
		echo '</li>';
	}
}
?></ul>

User avatar
Gasoline
Joomla! Explorer
Joomla! Explorer
Posts: 424
Joined: Tue Aug 23, 2005 10:33 am
Location: NL

Re: Bootstrap 5 dropdown menu in Joomla 4

Post by Gasoline » Wed Oct 13, 2021 9:45 am

organicwebs wrote:
Wed Oct 13, 2021 7:25 am
Using overides...

In templates/[my_template]/html/mod_menu folder, create this default.php file

(It's not perfect - just a start at getting Bootstrap5 text menus and dropdowns working....)

Code: Select all

<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_menu
 //
 // OrganicWebs modified - Oct 2021
 *
 * @copyright   (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Helper\ModuleHelper;

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $app->getDocument()->getWebAssetManager();
$wa->registerAndUseScript('mod_menu', 'mod_menu/menu.min.js', [], ['type' => 'module']);
$wa->registerAndUseScript('mod_menu', 'mod_menu/menu-es5.min.js', [], ['nomodule' => true, 'defer' => true]);

$id = '';

if ($tagId = $params->get('tag_id', ''))
{
	$id = ' id="' . $tagId . '"';
}

// The menu class is deprecated. Use mod-menu instead
?>
<ul<?php echo $id; ?> class="navbar-nav <?php echo $class_sfx; ?>">
<?php foreach ($list as $i => &$item){
	// Define the <li> class...
	$itemParams = $item->getParams();
	$class      = 'nav-item item-' . $item->id;

	if ($item->id == $default_id)
	{
		$class .= ' default';
	}

	if ($item->id == $active_id || ($item->type === 'alias' && $itemParams->get('aliasoptions') == $active_id))
	{
		$class .= ' current';
	}

	if (in_array($item->id, $path))
	{
		$class .= ' active';
	}
	elseif ($item->type === 'alias')
	{
		$aliasToId = $itemParams->get('aliasoptions');

		if (count($path) > 0 && $aliasToId == $path[count($path) - 1])
		{
			$class .= ' active';
		}
		elseif (in_array($aliasToId, $path))
		{
			$class .= ' alias-parent-active';
		}
	}

	if ($item->type === 'separator')
	{
		$class .= ' divider';
	}

	if ($item->deeper)
	{
//		$class .= ' deeper '; Old
		$class .= ' dropdown '; // OrganicWebs Bootstrap 5 
	}

	if ($item->parent)
	{
//		$class .= ' parent';	// OLD - not used in Bootstrap 5
	}

	######################
	// Print the <li> tag

	echo '<li class="' . $class . '">';

	switch ($item->type) :
		case 'separator':
		case 'component':
		case 'heading':
		case 'url':  // Formatting the <a> tag
//			require ModuleHelper::getLayoutPath('mod_menu', 'default_' . $item->type); // Old Joomla Menu
//			echo "<pre>".print_r ($item,1)."</pre>"; // Debug
			$a_class = $itemParams->get('menu-anchor_css'); 	// OrganicWebs Bootstrap 5		
			if ($item->current) $a_class .= " active"; 			// OrganicWebs Bootstrap 5	
			
			if ($item->parent) {
				// Dropdown Parent menu
				echo "<a class='nav-link dropdown-toggle' href='#' role='button' data-bs-toggle='dropdown' aria-expanded='false'> $item->title</a>"; // OrganicWebs Bootstrap 5
			}
			elseif ($item->level > 1) {
				// Menu Link in a dropdown	
				echo "<a class='dropdown-item $a_class ' href='/$item->route' > $item->title </a>"; // OrganicWebs Bootstrap 5 
			}
			else {
				// Standard Menu Link
				echo "<a class='nav-link $a_class ' href='/$item->route' > $item->title </a>"; // OrganicWebs Bootstrap 5 
			}
			break;

		default:
			require ModuleHelper::getLayoutPath('mod_menu', 'default_url');
			break;
	endswitch;

	// The next item is deeper.
	if ($item->deeper)
	{
//		echo '<ul class="mod-menu__sub list-unstyled small">';  // OLD
		echo '<ul class="dropdown-menu" aria-labelledby="navbarDropdown">';  // OrganicWebs Bootstrap 5
	}
	// The next item is shallower.
	elseif ($item->shallower)
	{
		echo '</li>';
		echo str_repeat('</ul></li>', $item->level_diff);
	}
	// The next item is on the same level.
	else
	{
		echo '</li>';
	}
}
?></ul>
I'll give it a try. Thanks

P.S. I don't understand that Joomla 4 ships with BS5 but the menu inside is not.
Using Joomla since 2005

User avatar
Pavel-ww
Joomla! Explorer
Joomla! Explorer
Posts: 450
Joined: Tue Jun 30, 2020 12:17 pm

Re: Bootstrap 5 dropdown menu in Joomla 4

Post by Pavel-ww » Wed Oct 13, 2021 11:38 am

organicwebs wrote:
Wed Oct 13, 2021 7:09 am
I don't understand why Joomla says it is bootstrap 5 compatible - when it doesn't actually use it with it's native code or default components? Is there something I'm missing???
Gasoline wrote:
Wed Oct 13, 2021 9:45 am
P.S. I don't understand that Joomla 4 ships with BS5 but the menu inside is not.
Hi. This is not a question of Joomla, but the question of the template. J4 comes with BS 5 in the backend template and in the Cassiopea template. Override for the drop-down menu is also belong to the Cassiopea, but not to core Joomla system. Therefore, the presence of BS 5 and drop-down menu in your own template is only in your hands.

Everything is absolutely exactly the same as in J3. For the frontend template, you can use absolutely any technology, you just need to override the standard Joomla things in your template, taking into account the technology you use.

If you create your template on the basis of Cassiopea, then there bootstrap components are not connected by default. This is done to improve performance, so that the user connects only what is needed. To connect, you need to create override in the template folder and place there call the desired bootstrap component.

Example with override in Cassiopea the Custom Module for using carousel
1.jpg
You do not have the required permissions to view the files attached to this post.
Last edited by Pavel-ww on Wed Oct 13, 2021 12:09 pm, edited 1 time in total.

User avatar
Gasoline
Joomla! Explorer
Joomla! Explorer
Posts: 424
Joined: Tue Aug 23, 2005 10:33 am
Location: NL

Re: Bootstrap 5 dropdown menu in Joomla 4

Post by Gasoline » Wed Oct 13, 2021 12:02 pm

Pavel-ww wrote:
Wed Oct 13, 2021 11:38 am
Gasoline wrote:
Wed Oct 13, 2021 9:45 am
P.S. I don't understand that Joomla 4 ships with BS5 but the menu inside is not.
Hi. This is not a question of Joomla, but the question of the template. J4 comes with BS 5 in the backend template and in the Cassiopea template. Override for the drop-down menu is also belong to the Cassiopea, but not to core Joomla system. Therefore, the presence of BS 5 and drop-down menu in your own template is only in your hands.

Everything is absolutely exactly the same as in J3. For the frontend template, you can use absolutely any technology, you just need to override the standard Joomla things in your template, taking into account the technology you use.

If you create your template on the basis of Cassiopea, then there bootstrap components are not connected by default. This is done to improve performance, so that the user connects only what is needed. To connect, you need to create override in the template folder and place there call the desired bootstrap component.

Example with override in Cassiopea the Custom Module for using carousel
1.jpg
I see it differently, the menu in Joomla (independed from the template) is not BS5. It would be nice if it was, or at least there was the option to choose it when you add a menu.
Using Joomla since 2005

organicwebs
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Oct 13, 2021 7:00 am

Re: Bootstrap 5 dropdown menu in Joomla 4

Post by organicwebs » Wed Oct 13, 2021 12:14 pm

Bummer.

I didn't wait years - just to get into the same issues that J3 had. I thought people were making this clear to the Joomla team.

I think some of us would have hoped that Joomla 4 would have used this Bootstrap structure for menus...
ie: https://getbootstrap.com/docs/5.0/components/navbar/

Instead - we get something else produced by the Joomla Core that we have to hack/override - its a messy solution.

I'm starting to realise that if you want to develop applications that use the simplicity of bootstrap... sadly Joomla is not the CMS to use.

Cassiopea has 13,000 lines in its CSS - that is insane. I don't want to go down that road of even touching that.

My template CSS are around 400 lines - short sweet manageable - uses bootstrap to do the heavy lifting.

But maybe I should change my thinking... maybe dump Bootstrap for something that is truely native with Joomla? What frontend Framework is Joomla 4 using then? Does it have the documentation like Bootstrap?

User avatar
Pavel-ww
Joomla! Explorer
Joomla! Explorer
Posts: 450
Joined: Tue Jun 30, 2020 12:17 pm

Re: Bootstrap 5 dropdown menu in Joomla 4

Post by Pavel-ww » Wed Oct 13, 2021 12:17 pm

Gasoline wrote:
Wed Oct 13, 2021 12:02 pm
I see it differently, the menu in Joomla (independed from the template) is not BS5. It would be nice if it was, or at least there was the option to choose it when you add a menu.
I think it would not be right. Since when developing own template, the developer would have to work not only with a clean code, but also to delete that it is not required from core extensions. If you are a template developer, you should understand this. If you are just a user, then use ready-made templates with what you need on board.

If you are talking about Cassiopea, there is a drop-down menu on board. You can choose it in the menu module settings.

User avatar
Pavel-ww
Joomla! Explorer
Joomla! Explorer
Posts: 450
Joined: Tue Jun 30, 2020 12:17 pm

Re: Bootstrap 5 dropdown menu in Joomla 4

Post by Pavel-ww » Wed Oct 13, 2021 12:36 pm

organicwebs wrote:
Wed Oct 13, 2021 12:14 pm
I think some of us would have hoped that Joomla 4 would have used this Bootstrap structure for menus...
ie: https://getbootstrap.com/docs/5.0/components/navbar/

Instead - we get something else produced by the Joomla Core that we have to hack/override - its a messy solution.

I'm starting to realise that if you want to develop applications that use the simplicity of bootstrap... sadly Joomla is not the CMS to use.
Perhaps yes, you should change thinking. You develop a template, but at the same time think as a user.

For example, I can't tolerate Bootstrap, except that only its components. I do not need navigation from Bootstrap. I want to have freedom and this is exactly Joomla allows to do without having any binding to technologies. Clear sheet. Therefore, you are very mistaken, saying that Joomla is not suitable for this.

Modern CSS/JS technology make it possible to create a more easy code and in smaller quantity than the same bootstrap grid.

And I think in your template is not 400 lines of code. Considering code from bootstrap you will get much more lines of code than it is in Cassiopea (there bootstrap is included in the main css and only for compatibility)

User avatar
Gasoline
Joomla! Explorer
Joomla! Explorer
Posts: 424
Joined: Tue Aug 23, 2005 10:33 am
Location: NL

Re: Bootstrap 5 dropdown menu in Joomla 4

Post by Gasoline » Wed Oct 13, 2021 1:28 pm

Pavel-ww wrote:
Wed Oct 13, 2021 12:36 pm
organicwebs wrote:
Wed Oct 13, 2021 12:14 pm
I think some of us would have hoped that Joomla 4 would have used this Bootstrap structure for menus...
ie: https://getbootstrap.com/docs/5.0/components/navbar/

Instead - we get something else produced by the Joomla Core that we have to hack/override - its a messy solution.

I'm starting to realise that if you want to develop applications that use the simplicity of bootstrap... sadly Joomla is not the CMS to use.
Perhaps yes, you should change thinking. You develop a template, but at the same time think as a user.

For example, I can't tolerate Bootstrap, except that only its components. I do not need navigation from Bootstrap. I want to have freedom and this is exactly Joomla allows to do without having any binding to technologies. Clear sheet. Therefore, you are very mistaken, saying that Joomla is not suitable for this.

Modern CSS/JS technology make it possible to create a more easy code and in smaller quantity than the same bootstrap grid.

And I think in your template is not 400 lines of code. Considering code from bootstrap you will get much more lines of code than it is in Cassiopea (there bootstrap is included in the main css and only for compatibility)
I don't agree.
I'm very good at HTML/CSS but not so good in JS and PHP.
I always had issues with menu's. Because than you need to code. Why not make it available or at least make a manual. I think that would be opening Joomla for a very wide group of people.
I love Joomla, the overrides, the MVC framework etc. And it works very well. And J4 is so much better. But the menu's are something else.
Using Joomla since 2005

organicwebs
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Oct 13, 2021 7:00 am

Re: Bootstrap 5 dropdown menu in Joomla 4

Post by organicwebs » Wed Oct 13, 2021 1:30 pm

Thanks for your insight Pavel - I do appreciate your time in responding.

I guess if you are into designing responsive frontends from the ground up and being creative with that - I see your point (and appreciate your skills!).

Where I'm coming from - I cannot spend a lot of time developing a template. I need to focus my time in developing the functionality of the backend code - building the function/purpose that a particular website needs (ie: might be a membership system, or a quoting system) - and I don't want to get tied up in the responsive frontend - so I leave that to Bootstrap. For me... knowing Bootstrap, I can get it to look the way the clients wants quickly and it will still be responsive. But my clients are just after standard looks and basic functionality - nothing radically creative.

After spending two days trying to get Cassiopea to look like what my client wanted... I realised that was not a good way forward (been down that road each major version since Joomla 1).

Sticking to the topic...

Unless somebody knows better... as far as I understand... for Bootstrap to work with the Joomla Menus - we have to HTML overide the Joomla mod_menu default.php file. (And same goes with the other core Joomla modules and formatting). To me - that's a hack. Any security patches involving the overide files will be ignored.

But I'm an old coder... maybe there is a newer/better way of getting Bootstrap 5 to work with Joomla menus?


PS: Here is the Joomla Doc link for activating Bootstrap components...
https://docs.joomla.org/J4.x:Using_Boot ... n_Joomla_4

User avatar
Jaydot
Joomla! Explorer
Joomla! Explorer
Posts: 475
Joined: Sun Jun 04, 2017 12:11 pm
Location: The Netherlands
Contact:

Re: Bootstrap 5 dropdown menu in Joomla 4

Post by Jaydot » Wed Oct 13, 2021 2:24 pm

I hesitated about joining this discussion, because I consider myself a user who happens to be good at CSS.
My coding knowledge is more or less limited to Hello World in three languages :).

But I agree with Pavel-ww in this: I really don't like Bootstrap for layout (I do love the components). Although admittedly it works well, I don't like the way it looks.

Obviously, @organicswebs has a different take on this, and I do understand his point of view.

But so far, I am really enjoying working with Cassiopeia, with it's CSS grid for the general page layout.

I can get menu's to look exactly the way I want them. So I'm curious, @Gasoline, are the menus I make overly simple?
(Here's an example of a menu I made: https://j4migration.jaydot.nl/ - and please don't comment on the layout in general. This is what the owner wanted: a remake of her ancient Protostar site).
The fact that an opinion is widely held is no evidence whatsoever that it is not utterly absurd.
Personal website: https://jaydot.nl

User avatar
Gasoline
Joomla! Explorer
Joomla! Explorer
Posts: 424
Joined: Tue Aug 23, 2005 10:33 am
Location: NL

Re: Bootstrap 5 dropdown menu in Joomla 4

Post by Gasoline » Wed Oct 13, 2021 2:47 pm

Jaydot wrote:
Wed Oct 13, 2021 2:24 pm
I hesitated about joining this discussion, because I consider myself a user who happens to be good at CSS.
My coding knowledge is more or less limited to Hello World in three languages :).

But I agree with Pavel-ww in this: I really don't like Bootstrap for layout (I do love the components). Although admittedly it works well, I don't like the way it looks.

Obviously, @organicswebs has a different take on this, and I do understand his point of view.

But so far, I am really enjoying working with Cassiopeia, with it's CSS grid for the general page layout.

I can get menu's to look exactly the way I want them. So I'm curious, @Gasoline, are the menus I make overly simple?
(Here's an example of a menu I made: https://j4migration.jaydot.nl/ - and please don't comment on the layout in general. This is what the owner wanted: a remake of her ancient Protostar site).
I do understand your point. I'm capable of making a menu in css, but I want it to be bootstrap menu for several reasons.

Your menu looks fine to me, and also works well on mobile. Don't know about MacOS, don't have those machines with me.

I prefer making my own templates from scratch and never use Joomla or other (basic)templates. So I'm in control, they are much lighter and customable in the future. I'm just finishing the first site in J4 for a client. Can show it in a week or so. For the menu I have chosen this solutions with regrets, because I want to add as less external things as possible. It had to be low cost so no energy in coding for this one for me.

I use BS so I don't need to do the basics. And only need to do the things I need to do for my template. I think with BS/Grid/Flexbox you can make perfectly nice designs. Especially if you'r good at CSS.
Using Joomla since 2005

User avatar
Pavel-ww
Joomla! Explorer
Joomla! Explorer
Posts: 450
Joined: Tue Jun 30, 2020 12:17 pm

Re: Bootstrap 5 dropdown menu in Joomla 4

Post by Pavel-ww » Wed Oct 13, 2021 2:58 pm

organicwebs wrote:
Wed Oct 13, 2021 1:30 pm
I need to focus my time in developing the functionality of the backend code - building the function/purpose that a particular website needs (ie: might be a membership system, or a quoting system) - and I don't want to get tied up in the responsive frontend - so I leave that to Bootstrap. For me... knowing Bootstrap, I can get it to look the way the clients wants quickly and it will still be responsive. But my clients are just after standard looks and basic functionality - nothing radically creative.

After spending two days trying to get Cassiopea to look like what my client wanted... I realised that was not a good way forward (been down that road each major version since Joomla 1).
Thanks for the assessment of my modest knowledge. I am also pleased with your participation here and very interesting to chat with the backend developer of extensions for Joomla.

Yes, I agree with you about Backend. But at the same time you speak about the frontend. There are many templates, including well-known developers built without Bootstrap. For example, something like Ukit or HiQ .

And if your client wants to use such a template, do you, as an extension developer, should not take into account this and use your own bootstrap on your extensions? That is, do the App not dependent on templates. Thus, the lack of bootstrap in the template should not disappoint you.

Cassiopea should be treated as such a template. This template does not use the Bootstrap grid. It can be said that the use of bootstrap is minimized. It is built mainly on native CSS - Flex & Grid. And if you create commercial expansions, they should work including in Cassiopea.

And in general, is the use of Bootstrap CSS redundant in extensions? If the template has a different framework on board, and the extension is forced to include its own bootstrap - it will turn out a whole bunch of code, which will adversely affect the performance of the site.

In my opinion, it is necessary to develop extensions on native CSS. Yes, spend some time first. But then it will be light and independent.

If you compare the speed of the work and the volume of the Bootstrap mesh code and only a few rows for the same grid on CSS Grid, the advantage in the production time and satisfaction of your customers seems obvious.

But of course I do not teach you. Just always wanted to share these thoughts with the developer of extensions. I'm just a webmaster who makes client sites. And performance is an eternal pain for me and my customers when extensions use bootstrap. But unfortunately, the developers are not inconvenient about it, but simply do as it is comfortable.


Post Reply

Return to “Templates for Joomla! 4.x”