-
AuthorPosts
-
jga159 Friend
jga159
- Join date:
- December 2010
- Posts:
- 32
- Downloads:
- 0
- Uploads:
- 11
- Thanks:
- 9
- Thanked:
- 1 times in 1 posts
February 21, 2011 at 8:10 pm #160527Hi
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 ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
February 21, 2011 at 9:26 pm #377825You 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 Friendhamlethub
- Join date:
- February 2011
- Posts:
- 128
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 15
- Thanked:
- 3 times in 1 posts
August 23, 2012 at 7:14 pm #465136I 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 FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
August 24, 2012 at 10:02 am #465202Hi 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.
-
AuthorPosts
This topic contains 4 replies, has 4 voices, and was last updated by Sherlock 12 years, 3 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum