Replace JS with twig rendering