Pimcore Twig Templating Helpers set type="text/javascript"

256 views Asked by At

I have done the following in pimcore, using Twig instead of PHP;

{% do pimcore_head_script().appendFile(asset('static/js/page.min.js')) %}

which results in the following when I "view source".

<script src="/static/js/page.min.js"></script>

Now, I need to make the add type="text/javascript" to this portion, so that it looks like this;

<script type="text/javascript" src="/static/js/page.min.js"></script>

However, I do not know how to do it. There isnt much documentation on how to do via Twig syntax. I have tried many iterations, but to no avail.

1

There are 1 answers

0
Robbi On

As described in pimcore 10 documentation, this should be possible:

{% do pimcore_head_script().appendFile(
    '/js/prototype.js',
    'text/javascript',
    {conditional: 'lt IE 11'}
%}