Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • jga159 Friend
    #160527

    Hi
    I’m triying to add a custom javascript in the template. I saw here and there and on the wiki that all I have to do is to put on the layout

    <scripts>
    <file>js/my-file-name.js</file>
    </scripts>

    and to clear cache. I’ve tried putting the .js in templates/ja_rave/js/my-file-name.js. No way. I also tried templates/ja_rave/local/themes/my-template/js/my-file-name.js and cleared cache again and again, the javascript doesn’t load in the page.
    What can I do ?

    Phill Moderator
    #377825

    You can put it in head.php

    Simply copy the head.php file from plugins>system>jat3>base-themes>default>blocks>head.php and place a copy of that file in templates>ja_rave>blocks

    Then add you custom code in the new location of head.php

    hamlethub Friend
    #465136

    I am having a similar issue trying to install Google DSP – their ad server.

    I need to have a script inserted into the <head> tags on every page.

    I believe you have given two methods of doing this, one is above, modifying the head.php file, the other is modifying te default.php file.

    I am using Joomla 2.5 with Teline IV – which do you recommend as the most efficient?

    If it is to put it into the head.php file, where exactly do you insert the text?

    <script type=”text/javascript”>
    var siteurl='<?php echo JURI::base(true) ?>/’;
    var tmplurl='<?php echo JURI::base(true).”/templates/”.T3_ACTIVE_TEMPLATE ?>/’;
    var isRTL = <?php echo $this->isRTL()?’true’:’false’ ?>;
    </script>

    <jdoc:include type=”head” />

    <?php if (T3Common::mobile_device_detect()==’iphone’):?>
    <meta name=”viewport” content=”width=device-width; initial-scale=1.0; maximum-scale=1; user-scalable=1;” />
    <meta name=”apple-touch-fullscreen” content=”YES” />
    <?php endif;?>

    <?php if (T3Common::mobile_device_detect()):?>
    <meta name=”HandheldFriendly” content=”true” />
    <?php endif;?>

    <link href=”<?php echo T3Path::getUrl(‘images/favicon.ico’) ?>” rel=”shortcut icon” type=”image/x-icon” />

    <?php JHTML::stylesheet (”, ‘templates/system/css/system.css’) ?>
    <?php JHTML::stylesheet (”, ‘templates/system/css/general.css’) ?>

    Sherlock Friend
    #465202

    Hi hamlethub,

    I think you should modify the default.php in this case, open that file you would find the tag of <head> just adding your code blocks right under that tag.

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 4 replies, has 4 voices, and was last updated by  Sherlock 11 years, 8 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum