0

I want to separate the user account menu tabs structure into an individual page layout.

For short I want to remove the tabs, I know that the pages are different.

Snapshot attached.

enter image description here

What I have done so far is trying to use the theme suggestions but couldn't get any closer.

I get to know that it's being rendered from:

themes/bootstrap/templates/block/block--local-tasks-block.html.twig

1

You could create different twig templates for that three pages and remove the local tasks from the display. Depending on your theme, it may also be sufficient to just disable the "tabs" block on these three pages. Then you'd create a custom menu (and block) with these three links in it and display it where you need it.

0

You have to extend page.html.twig in your theme/templates folder with the name suggestion that you get on enabling twig debug and remove the header section from it.

Remove this code:

 {# Header #}
      {% if page.header %}
        {% block header %}
          <div class="col-sm-12" role="heading">
            {{ page.header }}
          </div>
        {% endblock %}
      {% endif %}

By this the tabs will be removed.

0

You can try this:

  function module_name_menu_local_tasks_alter(&$data, $route_name) {
  $routes = ['user.pass','user.login','user.register']; 
  if (in_array($route_name, $routes)) {
    unset($data['tabs'][0]['user.login']);
    unset($data['tabs'][0]['user.pass']);
    unset($data['tabs'][0]['user.register']); 
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.