Problem/Motivation
i want to be able to set namespaces for components in the *.info.yml files, like i can do for other twig templates
Steps to reproduce
After editing my themes info.yml file to this:
components:
namespaces:
theme_templates:
- templates
theme_components:
- components
i can use this include with templates, but not with components
{% include '@theme_templates/components/icon/icon.twig' %} works
{% include 'theme_name:icon' %} works
{% include '@theme_components:icon' %} does not work
{% include 'theme_components:icon' %} does not work
Proposed resolution
make SDC respect and use component namespaces that is already in use
Comments
Comment #2
larowlanThe info.yml functionally is provided by components module in contrib, so should this issue be filed there?
Comment #3
anskelt commentedThat could be the case, i thought since we seem to not use the file in SDC, it could be on our part the problem exists.
Comment #4
kristen polWe don't want to get this into core so we don't have to use the components module anymore?
When pulling in UI Kits from outside of Drupal, allowing for namespaces is very important.
Comment #5
quietone commentedChanging project per comment #2.
Comment #6
quietone commentedComment #7
johnalbinSDC doesn't use Twig namespaces. Its API is better than Components' API, IMO.
SDC uses
[theme name]:[component name]. As you can see it just uses theme name and component name, and not any Twig namespace. Since it doesn't use Twig namespaces, there is nothing for it to respect.And since the Components module only affects Twig namespaces, it can't alter how SDC works.
These two APIs are independent of each other and can work simultaneously in a single theme without conflicting with each other.
The examples that "don't work" in the original post are examples of the user not following either API.