Skip to content

PatternData ksort combined with NavItemsExporter array indexes squashes components menu items together #173

@bdylanwalker

Description

@bdylanwalker

I have two components button and button-box. Buttons are what they sounds like. Button boxes are made up of a title, text, and button. I'm using the Gesso Drupal 8 theme which includes pattern lab, so these components are stored in directories named button and button-box under _patterns/03-components. When PL creates the navigation menu it puts all of the button components in the button box menu item. This is because the result of the ksort puts button and button-box before the component files stored in those directories. During the navigation export all the button components appear to be related to the button-box pattern. The result of the sort looks like this:

button
button-box
button-box/_button-box.scss
button-box/button-box.twig
button-box/button-box.yml
button/_button.scss
button/button.twig
button/button.yml

I can fix it by renaming the button directory to buttons, but I've run into a couple of other component names given by designers that are causing this problem so I'd like a better solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions