Skip to content
Snippets Groups Projects

Issue #3338283: Bootstrap 5: dropdown is too complicated

4 unresolved threads
4 unresolved threads

Merge request reports

Closed by Florent TorregrosaFlorent Torregrosa 1 year ago (Dec 7, 2023 9:25am UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 29 31 'auto_close': 'true',
    30 'dropdown_tag': 'li',
    31 'dropdown_navbar': true,
    32 'attributes': create_attribute({
    33 'class': ['nav-item']
    34 })
    35 }, 'dropdown') }}
    32 'tag': 'li',
    33 'attributes': item_attributes.addClass('nav-item')
    34 }) }}
    36 35 {% else %}
    37 <li{{ item.attributes.addClass('nav-item') }}>
    38 {{ link(item.title, item.url) }}
    36 <li{{ item_attributes.addClass('nav-item') }}>
    37 {% if item.title and item.url %}
    38 <a class="nav-link" href="{{ item.url }}">{{ item.title }}</a>
  • added 1 commit

    • 5dd70d81 - Issue #3338283 by pdureau, Grimreaper: Bootstrap 5: dropdown is too complicated

    Compare with previous version

  • 8
    9 /**
    10 * Handle variables needed for the pattern.
    11 */
    12 class PreprocessPatternNavbarNav {
    13
    14 /**
    15 * Handle variables needed for the pattern.
    16 *
    17 * @param array $variables
    18 * The preprocessed variables.
    19 */
    20 public function preprocess(array &$variables): void {
    21 foreach ($variables['items'] as &$item) {
    22 if (!($item['url'] instanceof Url)) {
    23 $item['url'] = Url::fromUri($item['url']);
  • 64 - title: "Action"
    65 url: "#"
    66 - title: "Another action"
    67 url: "#"
    68 - title: "Dropdown item text"
    69 - {}
    70 - title: "Disabled link"
    71 url: "#"
    72 attributes:
    73 class:
    74 - disabled
    75 - title: "Active link"
    76 url: "#"
    77 attributes:
    78 class:
    79 - active
  • 59 content:
    60 type: "menu"
    61 label: "Content"
    62 description: "A Drupal menu structure. Must be flat. Items without title are dividers. https://api.drupal.org/api/drupal/core!modules!system!templates!menu.html.twig/10.0.x"
    63 preview:
    64 - title: "Action"
    65 url: "#"
    66 - title: "Another action"
    67 url: "#"
    68 - title: "Dropdown item text"
    69 - {}
    70 - title: "Disabled link"
    71 url: "#"
    72 attributes:
    73 class:
    74 - disabled
  • The nav pattern is also impacted and has not been updated.

  • added 1 commit

    • ede7f603 - Issue #3338283 by pdureau, Grimreaper: WIP: make the refactoring work

    Compare with previous version

  • added 1 commit

    • d66075d5 - Issue #3338283 by pdureau, Grimreaper: WIP: make the refactoring work

    Compare with previous version

  • Please register or sign in to reply
    Loading