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

Customize the bottom menu #359

Open
pauco84 opened this issue Oct 25, 2022 · 1 comment
Open

Customize the bottom menu #359

pauco84 opened this issue Oct 25, 2022 · 1 comment

Comments

@pauco84
Copy link

pauco84 commented Oct 25, 2022

Hi every one,
I'm using Chameleon with the fixedhead layout.

I found out how to customize the bottom menu, so: I moved from the top menu the "Secondary-menu" down but I still have the tiny drop down symbol
image

Is there a way to change it with the "dropup" one? Should I do something with the class of the element? (I tried to add at the end <component type="Menu" message="secondary-menu" class="dropup"/> but of course is not working.

Many thanks in advance,
Paolo

@malberts
Copy link
Contributor

I don't have a solution for this at the moment, but here's some info in case somebody wants to try something.


The dropdown class is hardcoded when using the Menu component:

if ( $depth === 1 && !empty( $subitems ) ) {
return "<div class=\"nav-item dropdown\"><a class=\"nav-link dropdown-toggle $class\" href=\"#\" data-toggle=\"dropdown\" data-boundary=\"viewport\">$text</a>$subitems</div>";
} else {

Additionally, the class attribute coming from the layout XML is added to the a tag, not the dropdown div.

In the Toolbox component the class is added to the dropdown div:

$ulElement = IdRegistry::getRegistry()->element( 'div',
[ 'class' => 'nav-item p-tb-dropdown ' . $this->getClassString() ], $trigger . $liElement,
$this->indent( -1 ) );

Since these two different behaviors for class have been part of Chameleon for a while we need to be careful when coming up with a solution. Some people might be relying on the current behavior for styling purposes, so my initial feeling is we need to add a new attribute to the Menu component which allows specifying the direction, perhaps:

<component type="Menu" message="secondary-menu" direction="dropup"/>

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

No branches or pull requests

2 participants