Jump to content

Javascript template help


fusedwebspace

Recommended Posts

Hi all,

 

I'm trying what seems like a pretty simple thing in terms of a normal HTML website.

 

I'm wanting to add a ShareThis script to my website (fusedwebspace.co.uk).

 

The instructions are pretty simple, include a couple of lines in your head section and drop a script in the footer of you site.

 

I cant get it working for the life of me! The line's I need to ad into my head are;

 

<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript" src="http://s.sharethis.com/loader.js"></script>

 

So this is what my header.tpl file (in my active template) looks like;

 

<head>
   {$livehelpjs}
   <meta name="title" content="Unlimited web hosting | Fused Webspace">
   <meta name="description" content="Unlimited web hosting - Virtual servers - Dedicated servers - Hybrid servers - Magento hosting - Hosted exchange">
   <meta name="keywords" content="uk web hosting,virtual servers,dedicated servers,hybrid servers,magento hosting,hosted exchange,domain names,cheap domain names,fused webspace, unlimited web hosting">
   <meta name="owner" content="admin@fusedwebspace.co.uk">
   <meta name="author" content="Fused Webspace">
   <meta name="resource-type" content ="Document">
   <meta HTTP-EQUIV="expires" content="0">
   <meta HTTP-EQUIV="charset" content="UTF-8">
   <meta HTTP-EQUIV="content-language" content="en">
   <meta name="robots" content="index,follow">
   <meta name="revisit-after" content="2 days">
   <title>Unlimited web hosting | {$companyname}</title>
   {if $systemurl}<base href="{$systemurl}" />{/if}
   <script type="text/javascript" src="includes/jscript/jquery.js"></script>	
   {if $livehelpjs}{$livehelpjs}{/if}
   <link href="templates/{$template}/css/bootstrap.css" rel="stylesheet">
   <link href="templates/{$template}/css/whmcs.css" rel="stylesheet">
   <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
   <script src="templates/{$template}/js/whmcs.js"></script>
   {$headoutput}
   <link rel="stylesheet" href="templates/{$template}/html/css/style.css">
   <script src="templates/{$template}/html/js/jquery-1.7.1.min.js"></script>
   <script src="templates/{$template}/html/js/script.js"></script>
   <script src="templates/{$template}/html/js/forms.js"></script>

<script type="text/javascript">var switchTo5x=true;</script>	
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>	
<script type="text/javascript" src="http://s.sharethis.com/loader.js"></script>	

<!--[if lt IE 9]>
<script src="templates/{$template}/html/js/html5.js"></script>
<link rel="stylesheet" href="css/ie.css"> 
<![endif]-->

</head>

 

So, next up, assuming that is correct, is to drop the script into my footer file, just before the closing </body> tag I have gone for. I did read to wrap this stuff in a {literal} tag, which I have done,

 

</footer>
{$footeroutput}

{literal}
<script type="text/javascript">stLight.options({publisher: "d083e4f7-861d-4b47-9f27-b6f581fc2ce8", doNotHash: false, doNotCopy: false, hashAddressBar: true});</script>
<script>
var options={ "publisher": "d083e4f7-861d-4b47-9f27-b6f581fc2ce8", "logo": { "visible": true, "url": "http://www.fusedwebspace.co.uk/", "img": "http://www.fusedwebspace.co.uk/logo-bg.png", "height": 45}, "ad": { "visible": false, "openDelay": "5", "closeDelay": "0"}, "livestream": { "domain": "", "type": "sharethis", "customColors": { "widgetBackgroundColor": "#FFFFFF", "articleLinkColor": "#006fbb"}}, "ticker": { "visible": false, "domain": "", "title": "", "type": "sharethis", "customColors": { "widgetBackgroundColor": "#9d9d9d", "articleLinkColor": "#00487f"}}, "facebook": { "visible": false, "profile": "sharethis"}, "fblike": { "visible": true, "url": "http://www.facebook.com/fusedwebspace"}, "twitter": { "visible": true, "user": "sharethis"}, "twfollow": { "visible": true, "url": "http://www.twitter.com/fusedwebspace"}, "custom": [{ "visible": true, "title": "Google +1", "url": "http://plus.google.com/b/116598137507389953554/116598137507389953554/posts", "img": "", "popup": false, "popupCustom": { "width": 300, "height": 250}}, { "visible": false, "title": "Custom 2", "url": "", "img": "", "popup": false, "popupCustom": { "width": 300, "height": 250}}, { "visible": false, "title": "Custom 3", "url": "", "img": "", "popup": false, "popupCustom": { "width": 300, "height": 250}}], "chicklets": { "items": ["facebook", "googleplus", "twitter", "linkedin"]}, "background": "#000000", "color": "#FFFFFF", "shadow": "gloss", "arrowStyle": "light"};
var st_bar_widget = new sharethis.widgets.sharebar(options);
</script>
{/literal}

</body>

 

Can anyone help?

 

Thanks in advance,

 

Neal

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated