JS Includes Workaround

Permalink 1 user found helpful
I was building a website (not yet publically available) and wanted to include some additional jQuery functions for my design.

I stumbled accross an issue where adding my extra jscript includes wernt working properly.

Adding them before the <?php Loader::element('header_required'); ?> code broke my additional template functions.

Adding my js files after that line however broke the c5 admin functions (sitemap and templates).

A simple work around is this:

In the concrete/elements/header_required.php, place the following code.

<?php
//start jsincludes issue fix
$dashpath = urldecode($_SERVER['REQUEST_URI']);
if (strpos($dashpath, 'dashboard') !== FALSE)
{
//No extra JS needed as we are in dashboard
}else{
?>
[Place needed JS includes/code Here!]
<?php
} //end js includes issue fix
?>

This code should appear before the following code:

<?php
// output header items
print $this->controller->outputHeaderItems();
?>

Hope this helps someone out,

-Dave

 
synlag replied on at Permalink Reply
synlag
in context to this
http://www.concrete5.org/community/forums/chat/ui_jquery_themerolle...

i think, that's the solution.

Many thanks!