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

Styling the main menu (feature available since 3.19.0) #1079

Closed
dtrucs opened this issue Apr 2, 2024 · 1 comment
Closed

Styling the main menu (feature available since 3.19.0) #1079

dtrucs opened this issue Apr 2, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@dtrucs
Copy link
Collaborator

dtrucs commented Apr 2, 2024

The default requirements to use this feature are :

  • Geotrek Rando 3.19.0
  • connected to a Geotrek Admin 2.104.0

Since Geotrek Admin 2.104.0, you can define complex menu items.

If a submenu contains fewer than 5 items, or if none of the items in a submenu contains an image, the drop-down menu takes on the appearance of a "small" menu, if not the "large" menu.

Small Menu

It looks just like the old one (i.e. before version 3.19.0) and you shouldn't have to override the style. But you can always use the .custo-menu-* classes to do so.

image

Large Menu

To manage this complex menu, styles and elements are added to play with customization.
Please note that links in submenus are sorted into 2 groups: links without images (custo-menu-group--without-imgs) and links with images (.custo-menu-group--with-imgs).

Default style

image

Example to balance photos

If you have more photos to display and want to balance the structure, you can for example add these selectors to your customization/theme/style.css.

image

.custo-menu-sub-menu {
  align-items: start;
}
.custo-menu-sub-menu .custo-menu-group--with-imgs {
  flex-direction: row;
  flex-wrap: wrap;
  width: 430px;
}
.custo-menu-sub-menu .custo-menu-group--with-imgs a {
  flex-basis: 200px;
}

Example for submenus taking up the entire width of the screen

image

.custo-menu-item-wrapper {
  position: static;
}

.custo-menu-sub-menu {
  top: 100%;
  padding: 1rem 2rem;
}

/* Display links as row */
.custo-menu-group {
  flex-direction: row;
}

There may be other use cases, you can use this ticket as a question/answer.

@camillemonchicourt
Copy link
Member

Intégré dans la version 3.19 (nécessitant Geotrek-admin 2.104+) basée sur le nouveau système d'éléments de menu, complétant les pages statiques.
Documenté côté Geotrek-admin sur https://geotrek.readthedocs.io/en/latest/usage/static-pages.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: Livré / Testable en production
Development

No branches or pull requests

2 participants