# Sage 9 - external Js not defined

**URL:** https://discourse.roots.io/t/sage-9-external-js-not-defined/9860
**Category:** sage
**Tags:** sage9
**Created:** 2017-06-23T10:14:54Z
**Posts:** 27
**Showing post:** 15 of 27

## Post 15 by @Stephen — 2017-12-06T13:26:21Z

Muito obrigado Christian :slight_smile:

It’s really helpful to see how you’ve handled this! To declare the namespace for Barba, are you still doing this (below)?

> [@Best Practice / Resources for Blade](https://discourse.roots.io/t/best-practice-resources-for-blade/8341/48):
>
> Nope. I need it in the base.blade.php file. This is what I’m currently doing: templates/layouts/base.blade.php: ... \<div id="page-wrapper" role="document"\> \<div class="page-container" data-namespace="{!! $current\_template !!}"\> .... \</div\> \</div\> ... src/controller.php: add\_filter( 'sage/template/global/data', function( $data, $template ) { return ['current\_template' =\> basename( $template ,'.blade.php' ),]; }, 10, 2 );

---

_[View the full topic](https://discourse.roots.io/t/sage-9-external-js-not-defined/9860)._
