mirror of
https://gitlab.unicamp.br/infimecc_drupal11_modules/structural_pages.git
synced 2026-03-09 10:07:40 -03:00
Altera lógica de Site Section e adiciona redirect em content_page
- Adiciona campo field_redirect_link (link) no bundle content_page; EventSubscriber emite redirect 301 quando o campo está preenchido - field_site_section passa a ser obrigatório - Formulário de content_page: AJAX no site section, select hierárquico de página pai filtrado por seção, validação customizada - StructuralPagesMenuBlock: MAX_DEPTH 10→50, nova lógica de raiz via field_site_section, variável ancestor_url no render array - Template do menu: novas classes BEM/Gva, suporte a is_redirect, usa ancestor_url em vez de chamada Twig direta - CSS do menu reescrito com estilos flyout/sidebar; Select2 adicionado para o campo de página pai no formulário admin - display_submitted desabilitado no tipo content_page Co-Authored-By: Bauer <henrique@webcontent.com.br> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,63 +1,103 @@
|
||||
/**
|
||||
* @file
|
||||
* Styles for the structural pages menu block.
|
||||
* Structural Pages Menu - Custom Flyout Styles
|
||||
* Ensures the nested menu items fly out to the right exactly like the Gavias theme reference menu.
|
||||
*/
|
||||
|
||||
.structural-pages-menu {
|
||||
font-size: 0.9rem;
|
||||
.block-structural-pages-menu {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.structural-pages-menu__title {
|
||||
font-size: 1.1rem;
|
||||
margin-bottom: 0.75rem;
|
||||
padding-bottom: 0.5rem;
|
||||
border-bottom: 1px solid #ddd;
|
||||
/* Apply the gray background and padding directly to the nav so it remains styled even if detached by the sticky script */
|
||||
.sidebar .structural-pages-menu {
|
||||
padding: 30px;
|
||||
background-color: #f3f3f3;
|
||||
border-radius: 10px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.structural-pages-menu__title a {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
/* Remove the padding and background from the outer Drupal block wrapper to avoid double padding */
|
||||
.sidebar [id^="block-structuralpagesmenublock"] {
|
||||
padding: 0 !important;
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
.structural-pages-menu__title a:hover {
|
||||
text-decoration: underline;
|
||||
/* Position relative on parent items to anchor the absolute sub-menu */
|
||||
.structural-pages-menu .structural-pages-menu__item {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.structural-pages-menu__list {
|
||||
/* Hide sub-menus by default and position them to the right */
|
||||
.structural-pages-menu .sub-menu {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 100%;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
min-width: 260px;
|
||||
background-color: #ffffff;
|
||||
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
|
||||
z-index: 999;
|
||||
transition: all 0.25s ease-out;
|
||||
transform: translateY(10px);
|
||||
pointer-events: none;
|
||||
border-left: 2px solid var(--notech-theme-color, #db162f);
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.structural-pages-menu__list--level-2,
|
||||
.structural-pages-menu__list--level-3,
|
||||
.structural-pages-menu__list--level-4 {
|
||||
padding-left: 1rem;
|
||||
/* Show submenu on hover or focus */
|
||||
.structural-pages-menu .structural-pages-menu__item:hover>.sub-menu,
|
||||
.structural-pages-menu .structural-pages-menu__item:focus-within>.sub-menu {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
pointer-events: auto;
|
||||
padding: 5px 30px !important;
|
||||
}
|
||||
|
||||
.structural-pages-menu__item {
|
||||
margin: 0.25rem 0;
|
||||
/* Add an indicator icon (arrow) to items that have children */
|
||||
.structural-pages-menu .structural-pages-menu__item--has-children>a::after {
|
||||
content: " \203A";
|
||||
float: right;
|
||||
font-family: monospace;
|
||||
font-size: 1.4em;
|
||||
font-weight: bold;
|
||||
line-height: 0.8;
|
||||
opacity: 0.4;
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
|
||||
.structural-pages-menu__link {
|
||||
.structural-pages-menu .structural-pages-menu__item--has-children:hover>a::after {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Styles for the links inside the flyout menus */
|
||||
.structural-pages-menu .sub-menu>li>a {
|
||||
display: block;
|
||||
padding: 0.25rem 0.5rem;
|
||||
padding: 12px 20px;
|
||||
font-size: 14px;
|
||||
color: #333333;
|
||||
text-decoration: none;
|
||||
color: #333;
|
||||
border-radius: 3px;
|
||||
transition: background-color 0.15s ease;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
transition: all 0.2s ease;
|
||||
background-color: transparent;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.structural-pages-menu__link:hover {
|
||||
background-color: #f5f5f5;
|
||||
text-decoration: none;
|
||||
.structural-pages-menu .sub-menu>li:last-child>a {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.structural-pages-menu__link--active-trail {
|
||||
font-weight: 600;
|
||||
color: #0073bd;
|
||||
.structural-pages-menu .sub-menu>li>a:hover {
|
||||
color: var(--notech-theme-color, #db162f);
|
||||
background-color: #fcfcfc;
|
||||
padding-left: 25px;
|
||||
/* Subtle interactively indication */
|
||||
}
|
||||
|
||||
.structural-pages-menu__item--active-trail > .structural-pages-menu__link {
|
||||
background-color: #e8f4fc;
|
||||
}
|
||||
/* Ensure active trail items inside submenu remain highlighted */
|
||||
.structural-pages-menu .sub-menu .menu-item--active-trail>a,
|
||||
.structural-pages-menu .sub-menu .is-active {
|
||||
color: var(--notech-theme-color, #db162f);
|
||||
}
|
||||
Reference in New Issue
Block a user