Skip to content

Menu disregards contentType and bugs on 'identical' slugs #2432

@jvanoostrom

Description

@jvanoostrom

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:

  1. Create a record of contentType 'page' and name it 'contact'. Note that the slug will show /page/contact
  2. Create a record of contentType 'block' and name it 'contact'. Note that the slug will show /block/contact
  3. Add one item to the menu in menu.yaml like so:
main:
...
  - label: Contact
    title: Contact
    link: page/contact
  1. As you will see, no href will be set ({{ item.uri }} is empty)

Example fix:

  1. Change the name of the 'contact'-record of contentType 'block' to 'contactblock'. Note that the slug will show /block/contactblock
  2. Add the item to the menu in menu.yaml as described above.
  3. 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.

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