- Issue created by @mlncn
- Issue was unassigned.
- Status changed to Needs review
3 months ago 6:20pm 17 September 2024 - πΊπΈUnited States mlncn Minneapolis, MN, USA
For THEME HOOK: 'menu_local_action' for an action link to the Entity Print view, we now have two new suggestions:
FILE NAME SUGGESTIONS: βͺοΈ menu-local-action--entity-print--view.html.twig βͺοΈ menu-local-action--entity-print.html.twig β menu-local-action.html.twig
- πΊπΈUnited States mlncn Minneapolis, MN, USA
There is not a direct way to addClass to the link part of the action link template but you can if you are unhealthily committed to doing things only in templates, you can do the holy hell that is this:
{# /** * @file * Theme override for a single local action link. * * Available variables: * - attributes: HTML attributes for the wrapper element. * - link: A rendered link element. * * @see template_preprocess_menu_local_action() */ #} {% set link = link|merge({ '#options': link['#options']|merge({ 'attributes': link['#options']['attributes']|merge({ 'class': link['#options']['attributes']['class']|merge( ['btn'] ) }) }) }) %} <p{{ attributes }}>{{ link }}</p>
But i recommend doing like is done here, using the preprocess hook, instead: https://agaric.coop/blog/adding-bootstrap-button-stylings-drupal-8s-acti...