3

I am looking for a way to customize 'edit', 'view', 'delete' links.

I use bootstrap theme, but i use bootstrap v4 styles for it. I want to add 'nav-link' class to each link.

And find a way to display somewhere, not just below post title.

I couldnt find a tutorial about it. Where should i look for this? template parts (twig) or themename.theme file?

3 Answers 3

2

For preprocess function you can use HOOK_preprocess_menu_local_tasks(&$variables) {... where HOOK is the name of your active theme.

And for template suggestions you need to enable debugging and see with inspect element, as usual it must be menu-local-tasks.html.twig

enter image description here

0

You can customize the local tasks using menu-local-tasks.html.twig and menu-local-task.html.twig. The Stable core theme has samples of these files. You could also try using hook_preprocess_menu(&$vars) in your .theme file. I'm not sure if it processes the local menu items though. I am using it for the main menu.

-1

You could create your own tpl.php! I think there should be a template file within your bootstrap theme. Copy that file to your subtheme templates folder and edit it the way you want it to look like.

5
  • Sorry forgot to tell that I user drupal 8. which tpl file should I work on it? I can find drupal 8 version of that
    – weboloper
    Commented Jun 2, 2016 at 8:28
  • Sorry, I don't have used Drupal 8 yet - shame on me! But I would guess, that the template concept is still working. You could search for page.tpl.php (the whole page) or node.tpl.php (template for nodes). Search the bootstrap theme folder for a folder called templates, I guess, there you'll find these files!
    – Paul Max
    Commented Jun 2, 2016 at 8:50
  • Just had a look at bootstrap for Drupal 8. The concept seems to be the same as for Drupal 7 but the tpl.php - files now are the twig files!
    – Paul Max
    Commented Jun 2, 2016 at 8:57
  • which tpl file should i look for?
    – weboloper
    Commented Jun 2, 2016 at 9:02
  • you could have a look at page.html.twig, node.html.twig or the menu-local-task.html.twig / menu-local-tasks.html.twig
    – Paul Max
    Commented Jun 2, 2016 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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