Skip to content

ERATRANS-1057: Mega menu. #643

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

Open
wants to merge 11 commits into
base: development
Choose a base branch
from
Open

ERATRANS-1057: Mega menu. #643

wants to merge 11 commits into from

Conversation

tibi2303
Copy link
Collaborator

No description provided.

Copy link

github-actions bot commented Feb 14, 2025

🚀 Deployed on https://preview-643--oelibrary.netlify.app

@github-actions github-actions bot temporarily deployed to pull request February 14, 2025 01:42 Inactive
@github-actions github-actions bot temporarily deployed to pull request February 14, 2025 01:50 Inactive
@github-actions github-actions bot temporarily deployed to pull request February 16, 2025 21:44 Inactive
@tibi2303
Copy link
Collaborator Author

Prerelease done: 0.1057.202502162340.

@github-actions github-actions bot temporarily deployed to pull request February 17, 2025 18:34 Inactive
@github-actions github-actions bot temporarily deployed to pull request February 17, 2025 23:46 Inactive
@github-actions github-actions bot temporarily deployed to pull request February 18, 2025 00:05 Inactive
{% set _content_block = content_block|default('') %}
{% set _items = items|default([]) %}
{% set _back_button_label = back_button_label|default('Back') %}
{% set _icon_path = icon_path|default('') %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a min height parameter with a default value to what is now in ecl. If the content height is bigger, then scrolling is fine

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added. it's pixel based, the user can add any size but will default to 300px

{% endif %}
<div class="col-12 col-lg-8">
<div class="navigation-items">
{% for _item in _items %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look into a solution, css prefereply with some pseudo code or js if not, where if the first item in any column inside the meganenu has children, then we open it automatically 1st and 2nd level both (see ecl example)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added using js, there is no possibility with css

{% for _item in _items %}
{% if _item.items is defined %}
{% set _trigger_attributes = _item.trigger.attributes is defined ? _item.trigger.attributes : create_attribute() %}
{% include '@oe-bcl/bcl-dropdown/dropdown.html.twig' with _item|merge({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure that columns can be targeted separately in css if needed also toghter with their parent link

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they can, we have .content-block for first column, .navigation-items for second column, .navigation-items .dropdown-menu for third column and .collapse for 3rd column

@@ -124,6 +124,8 @@
{% include '@oe-bcl/bcl-dropdown/dropdown.html.twig' with _item only %}
{% elseif _item.button is defined %}
{% include '@oe-bcl/bcl-button/button.html.twig' with _item only %}
{% elseif _item.mega_menu is defined %}
{% include '@oe-bcl/bcl-mega-menu/mega-menu.html.twig' with _item only %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double check that it renders correclty when used inside a menu

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, fixed and now renders okay inside a menu


{% set attributes = attributes.setAttribute('aria-labelledby', _id).addClass(_classes) %}

{% if _trigger.attributes is empty %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when on tabled mode, the parent data should be displayed on top
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

}) only %}
{% if _item.collapse is defined %}
<div class="collapse">
{{ _item.collapse|raw }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this collapse|raw? please give me an example

Copy link
Collaborator Author

@tibi2303 tibi2303 Mar 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used to render properly the html... the encoding if the |raw is not added sees the collapse parameter as simple string and does not render it properly.. that's why i used raw here

@@ -0,0 +1,166 @@
/* stylelint-disable no-descending-specificity, declaration-no-important */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the second column should be white and the third gray as in ecl

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed the colors

@github-actions github-actions bot temporarily deployed to pull request March 2, 2025 21:32 Inactive
@github-actions github-actions bot temporarily deployed to pull request April 8, 2025 17:24 Inactive
@github-actions github-actions bot temporarily deployed to pull request April 8, 2025 19:14 Inactive
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

Successfully merging this pull request may close these issues.

2 participants