By weboloper on
Hello,
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?
Comments
And find a way to display
In Drupal 8 local tasks are a block, you can place them anywhere you want.
Is 'nav-link' meant to go on the anchor or the list item? There is a template
menu-local-task.html.twigwhere you can easily add classes to the list item.Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
hello, i want to add classes
hello, i want to add classes to anchors.
Use preprocess, I can never
Use preprocess, I can never seem to get setOption to work in templates...
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Need unique class for local task links
I need some Icons for my local task links. Therefor I need unique classes or ids for the local task items. I know, I can add classes in menu-local-task.html.twig. But how can I make them unique?
Thank you
I'm trying to do the same
I'm trying to do the same thing here... there does not seem to be any variable that hold a unique ID for each local task. My first approach was to output the title as a classname in the theme hook, ie:
$title = \Drupal\Component\Utility\Html::getClass($variables['element']['#link']['title']);but in a multilingual site that title changes...
J-F Bohémier
Angelicode.com
This worked for me
Sorry if it has been answered elsewere, but this worked for me to add "nav-link" to each link.
I've added it to the THEMENAME.theme file:
Great!
Thanks for sharing, just what I needed.
For Bootstrap 4
I have created a preprocess hook for menu-local-task. And altered the #link and its attributes.
Hope this helps someone.