Add via plugin a script block in every page/view

Hello :slight_smile:

Maybe you know a simple and quick way to permanently add a Javascript file to all views in the script block using the plugin system. How can this be achieved?

There is already this present in the app template

So you can then do something like

<?php $this->append('script'); ?>
<script>
    alert('Hello!');
</script>
<?php $this->end(); ?>

to your sub-template file

See Views - 4.x

1 Like

Thanks Kevin :+1: your solution works.