If one uses the Cassiopeia template and wants to use another horisontal menu extension as menu instead of Cassiopeias own menu, then Cassiopeias mobile menu icon is still shown.
A setting in the Cassiopeia template to deactivate showing the mobile menu icon. Otherwise a description shown in the template of how you can add some user css to do this.
Labels |
Added:
?
|
Labels |
Added:
?
|
@brianteeman actually the menu in casseiopeia is leaking hardcoded HTML and also JS behaviour when in reality all it needed was just to echo the module position. Templates should have the least hardcoded HTML and definitely not imposing JS behaviours:
joomla-cms/templates/cassiopeia/index.php
Lines 149 to 159 in 0dc0f7d
weird as it didnt happen for me.
If we turn off the mobile menu icon, how we make the mobile menu accessible?
If we turn off the mobile menu icon, how we make the mobile menu accessible?
The template should only have code for spitting out module positions and the component output. The menu's behaviour should belong to the menu module NOT the template. It's called separation of concerns...
The template should only have code for spitting out module positions and the component output.
So all we have to do is to move the html from joomla-cms/templates/cassiopeia/index.php (Lines 149 to 159) to the menu module? And then all we need to remove the mobile menu icon is to disable menu module. Am I right?
But you would still have to display the module position:
<jdoc:include type="modules" name="menu" style="none" />
- line 156
..for eg another menu extension you want to place in the menu position.
..so not that easy
..so not that easy
What are you talking about, probably you don't understand what I wrote.
This is fine
<?php if ($this->countModules('menu', true)) : ?>
<jdoc:include type="modules" name="menu" style="none" />
<?php endif; ?>
This is a spooky story from the last decade:
<?php if ($this->countModules('menu', true)) : ?>
<nav class="navbar navbar-expand-md">
<?php HTMLHelper::_('bootstrap.collapse', '.navbar-toggler'); ?>
<button class="navbar-toggler navbar-toggler-right" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="<?php echo Text::_('TPL_CASSIOPEIA_TOGGLE'); ?>">
<span class="icon-menu" aria-hidden="true"></span>
</button>
<div class="collapse navbar-collapse" id="navbar">
<jdoc:include type="modules" name="menu" style="none" />
</div>
</nav>
<?php endif; ?>
Am I right?
Yes, probably you should create a new layout, eg main-menu.php
or something similar
@dgrammatiko I was not refering to your post, but to @eopws about just removing the lines. I agree that it should only be:
`countModules('menu', true)) : ?>
<jdoc:include type="modules" name="menu" style="none" />
In the template, and the rest handled in the module.
sorry.. do not know why I cannot insert code correctly in the post ??
probably you should create a new layout, eg
main-menu.php
or something similar
If you have time, could you, please, explain what for?
could you, please, explain what for?
In short, this is down to the architecture of Joomla: Modules (or components) can have different output by using a different layout...
Maybe move this HTML
joomla-cms/templates/cassiopeia/index.php
Lines 149 to 159 in 0dc0f7d
To
joomla-cms/templates/cassiopeia/html/mod_menu/dropdown-metismenu.php
Lines 30 to 32 in 0dc0f7d
And then the button
will be shown only if "Main Menu Blog" module is published.
That will only work if you use Metismenu. The sample data were configured to show how to use Metismenu. But you can still have a "normal" Joomla menu on the menu position and it will not be responsive (burger menu) if you move the code into the Metismenu. What we need is a new menu layout (in core or in the template) that includes the Bootstrap part of the menu.
So we have to have two templates: one for a not responsible menu and one for a responsible menu and choose beetwen them depending on the option?
But I still can understand one thing - if a user have two menus on one position, the mobile menu icon should hide/show both of them or not?
if a user have two menus on one position, the mobile menu icon should hide/show both of them or not?
Menus should render things according to the selected layout. Default should be a simple <ul>
, collapsed will be with Bootstrap collapse button and collapse-dropdown with both the button and the metis dropdown... The architecture has the solution for these things, no extra switches needed, in fact, no extra switches should ever being introduced as they break the concept of responsibility (the form is for data, layout options should always be handled in the LAYOUTS)
@dgrammatiko Thanks.
And sorry for silly questions :)
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-05-19 15:09:45 |
Closed_By | ⇒ | richard67 |
Cassiopeia doesnt have a menu. I am assuming you are referring to the existing menu published using the core menu module. If that isnt published then it cant and doesnt generate a mobile menu