using CMSB to manage example.js?

3 posts by 2 authors in: Forums > CMS Builder
Last Post: January 25, 2016   (RSS)

By Toledoh - January 24, 2016

Hi Guys.

I want CMSB to maintain elements within a .js file that I would normally link in by something like;

<script src="<?php echo PREFIX_URL ?>/assets/js/example.js"></script>

Do you see any issues in me having a example.php file with the standard CMSB code, with an inline script:

<script>
// use variable such as <?php echo ($variablesRecord['variable1']) ?>
</script>

Or can I create example.js.php like I do for XML files like sitemap.xml.php?

What would be the best way to go?

Cheers,

Tim (toledoh.com.au)

By Toledoh - January 25, 2016

Thanks Greg.  I'll use the example.php as I want to re-use those variables through the site. 

Cheers,

Tim (toledoh.com.au)