- Issue created by @mengi
- π«π·France Grimreaper France π«π·
Hi,
Thanks for opening the issue so I can put my Slack response publicly:
I am having nightmares with dropdown and navbar_nav, we had to rework it a lot since 2 years.
So it is a prop for links integration.
In https://git.drupalcode.org/project/sobki_profile_bootstrap/-/blob/10.0.x..., I have an example of simple_megamenu integration (UIP1 for the moment) and it acts on a hook_preprocess_menu that you may not have if using dropdown elsewhere.
We can discuss with Pierre what would be the best:
- override the dropdown component/create a new one on your side
- try to inject your block in content and check how links prop type normalization happens and if we will have to adapt it in UIP2
- π«π·France pdureau Paris
Indeed, there is an example with a form in a dropdown in upstream doc: https://getbootstrap.com/docs/5.3/components/dropdowns/#forms
We can imagine adding two slots: one before
{% for item in content %}...{% endfor %}
and one after.However, that would mean doing heavy and risky change in the HTML structure, without the guarantee to work properly at the end:
{% if content %} {% if before %} <div{{ dropdown_menu_attributes }}> {{ before }} <ul> {% else %} <ul{{ dropdown_menu_attributes }}> {% endif %} {% for item in content %}
So, I advise not implementing this in the theme, and let users oiverriding the component if they need.