- Issue created by @rgnyldz
- 🇳🇱Netherlands nk_
Never put assets directly in Twig/HTML, this is for what you have libraries in Drupal.
Your best bet, very standard Drupal way for the situation when you want library literally everywhere, and that it does not multiply and conflict is this
/** * Implements hook_page_attachments_alter(). */ function YOUR_MODULE_NAME_page_attachments_alter(&$page) { /* Attach this library just everywhere, with no config on pages/scopes where is normally triggered. */ // If you use default, CDN current version $page['#attached']['library'][] = 'swiper_formatter/remote'; // OR remove previous line and have this one uncommented, if you are using local version. // $page['#attached']['library'][] = 'swiper_formatter/local'; }
Or you can also try something like
{{ attach_library('swiper_formatter/remote') }}
in your twig (page.html.twig or html.html.twig) but I really do not recommend this. - 🇳🇱Netherlands nk_
As for Breakpoints you mentioned, see here how you can easily implement it:
https://www.drupal.org/project/swiper_formatter/issues/3318311#comment-1... 💬 Responsive breakpoints Needs work - Status changed to Closed: works as designed
8 months ago 11:55am 5 April 2024