Hi!

This would be a nice module. But unfortunately, I get the following Error (500):
mod_fcgid: stderr: Uncaught PHP Exception Symfony\\Component\\Routing\\Exception\\RouteNotFoundException: "Route "" does not exist." at .../core/lib/Drupal/Core/Routing/RouteProvider.php line 191

Thanks for your help!

Comments

Michèle created an issue. See original summary.

danielbeeke’s picture

To get this module working you have to do a couple of things.

You have to add the following to the services.yml.

  menu.default_tree_manipulators:
    class: Drupal\menu_link_placeholder\Menu\MenuLinkPlaceholderMenuLinkTreeManipulators
    arguments: ['@access_manager', '@current_user', '@entity.query']

You have to edit your menu.html.twig file:

                {% if item.no_link %}
                    <span class="menu-placeholder menu-link">{{ item.title|raw }}</span>
                {% else %}
                    {{ link(item.title, item.url) }}
                {% endif %}

I hop this helps, if not, I am on IRC at the moment with the username danielbeeke3

Michèle’s picture

Thanks for your reply! I didn't found you on IRC...
I did these steps (created services.yml, inserted the content of menu_link_placeholder.services.yml and edited menu.html.twig...
Cleared caches multiple times, but no luck.

danielbeeke’s picture

I am in IRC: #drupal as danielbeeke or danielbeeke3

Is it still the same error?

danielbeeke’s picture

I have had contact on IRC, this is more a support issue than a bug.
This module is not yet plug and play.

The error in the issue description comes when you use the standard menu.html.twig.
It is important the services yaml is working, if it is not working you will not see the empty menu links when logged out. It will not throw an error.

danielbeeke’s picture

Component: Code » Documentation
Category: Bug report » Support request
Priority: Critical » Normal
Status: Active » Closed (cannot reproduce)