Site name and Javascript

Permalink
Is there a way to get the site name from within a block of javascript?

tallacman
 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi tallacman,

Do you need the site name in a JavaScript file or in a script tag?
tallacman replied on at Permalink Reply
tallacman
I have this:

;(function ($, document, window) {
    var
    // default settings object.
        defaults = {
            label: 'MENU',
            duplicate: true,
            duration: 200,
            easingOpen: 'swing',
            easingClose: 'swing',
            closedSymbol: '►',
            openedSymbol: '▼',
            prependTo: '.ccm-page',
            parentTag: 'a',
            closeOnClick: false,
            allowParentLinks: false,


and the brand: 'Theme Name' is where I need the site name.
MrKDilkington replied on at Permalink Reply
MrKDilkington
If this is in a view, or similar place where you can use PHP, you could try this.
<?php echo Config::get('concrete.site'); ?>

Example: for testing
<script>
console.log('<?php echo Config::get('concrete.site'); ?>');
</script>

Example: in your script
brand: '<?php echo Config::get('concrete.site'); ?>',