Using the built in menu builder, it is possible to create a menu that utilises links to contentTypes and records of contentTypes. However, when there exist two records with the same name (hence slug) in different contentTypes, the menu builder does not generate a link using <a href='{{ item.uri }}'>Link</a>. The {{ item.uri }} is empty.
Details
| Question |
Answer |
| Relevant Bolt Version |
master |
| Install type |
Composer install |
| BC Break |
N/A |
| PHP version |
7.4 |
| Web server |
Built-in, symfony |
| For UX/UI issues |
N/A |
Reproduction
If you're filing a bug, please describe how to reproduce it. Include as much
relevant information as possible, such as:
Bug summary
Using the built in menu builder, it is possible to create a menu that utilises links to contentTypes and records of contentTypes. However, when there exist two records with the same name (hence slug) in different contentTypes, the menu builder does not generate a link using <a href='{{ item.uri }}'>Link</a>. The {{ item.uri }} is empty.
Specifics
See table above.
Steps to reproduce
Example reproduction:
- Create a record of contentType 'page' and name it 'contact'. Note that the slug will show
/page/contact
- Create a record of contentType 'block' and name it 'contact'. Note that the slug will show
/block/contact
- Add one item to the menu in
menu.yaml like so:
main:
...
- label: Contact
title: Contact
link: page/contact
- As you will see, no
href will be set ({{ item.uri }} is empty)
Example fix:
- Change the name of the 'contact'-record of contentType 'block' to 'contactblock'. Note that the slug will show
/block/contactblock
- Add the item to the menu in
menu.yaml as described above.
- The link will now correctly displayed, the
href attribute is set as {{ item.uri }} is not empty.
Expected result
The link is properly generated.
Actual result
The link is not generated.
Using the built in menu builder, it is possible to create a menu that utilises links to contentTypes and records of contentTypes. However, when there exist two records with the same name (hence slug) in different contentTypes, the menu builder does not generate a link using
<a href='{{ item.uri }}'>Link</a>. The{{ item.uri }}is empty.Details
Reproduction
If you're filing a bug, please describe how to reproduce it. Include as much
relevant information as possible, such as:
Bug summary
Using the built in menu builder, it is possible to create a menu that utilises links to contentTypes and records of contentTypes. However, when there exist two records with the same name (hence slug) in different contentTypes, the menu builder does not generate a link using
<a href='{{ item.uri }}'>Link</a>. The{{ item.uri }}is empty.Specifics
See table above.
Steps to reproduce
Example reproduction:
/page/contact/block/contactmenu.yamllike so:hrefwill be set ({{ item.uri }}is empty)Example fix:
/block/contactblockmenu.yamlas described above.hrefattribute is set as{{ item.uri }}is not empty.Expected result
The link is properly generated.
Actual result
The link is not generated.