In my case I want to write some javascript code inside the paragraph-something.hmtl.twig taking elements from the theme variables and then putting this javascript attached to the bottom of the page. Something like:
{{ attach_library('my/code') }}
but being able to write the code dynamically and not link to a js file pre-comp.
I am trying to redirect visitors if it is their first time on site.
I beleive in drupal 7, this could be done on itialization using init().
Im using a gated content module to check with cookies if a user has already visited the site before. But this uses JS and is executed once dom is fully loaded.
Im trying to find a way to detect at the earliest point. Before any content is load if possible.
What sort of function should I be looking at?
I know is a generic question but just looking for a starting point. Thanks
I have a content type with a simple colorbox gallery. I wanted to have the caption (title or alt) directly on the page and not just at the lightbox. Is there a way to realise this?