Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Banners on silverstripe

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1 2
Go to End
Author Topic: 2882 Views
  • HanSolo
    Avatar
    Community Member
    83 Posts

    Banners on silverstripe Link to this post

    Hi I been trying to figue out how to put banners on my homepage. I enrolled with a banner affiliate program, they generated some javascript code. I tried to implement the code in page.ss but then i foundout that there should not be any code in that page.

    How would the best way to implement the javascript code be?

    The code looks like this.

    script type="text/javascript"
    var uri = 'http://imp.tradedoubler.com/imp?type(js)pool(281627)a(1545256)' + new String (Math.random()).substring (2, 11);
    document.write('<sc'+'ript type="text/javascript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
    /script

  • HanSolo
    Avatar
    Community Member
    83 Posts

    Re: Banners on silverstripe Link to this post

    Any got a clue on this I searched the forum but have not find any answer that made me understand it.

    Joakim

  • Fuzz10
    Avatar
    Community Member
    786 Posts

    Re: Banners on silverstripe Link to this post

    It doesn't work if you just put the code in your template for the homepage ?

  • HanSolo
    Avatar
    Community Member
    83 Posts

    Re: Banners on silverstripe Link to this post

    Shall i put the javascript in the folder sapphire/javascript?
    And how do I include it inthe pages, as an include in the templates?

    Joakim

  • HanSolo
    Avatar
    Community Member
    83 Posts

    Re: Banners on silverstripe Link to this post

    Anyone got some ideas on that?

  • Fuzz10
    Avatar
    Community Member
    786 Posts

    Re: Banners on silverstripe Link to this post

    Try pasting your piece of script in the appropriate template (e.g. homepage.ss).

  • HanSolo
    Avatar
    Community Member
    83 Posts

    Re: Banners on silverstripe Link to this post

    when i insert it on the page.ss i will get an error about xml not wellformated
    but if i delete the
    document.write('<sc'+'ript type="text/javascript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
    then i will not receive an error so i guess it something wrong with this part document.write('<sc'+'ript

    How would be the best way to solve this?

  • Fuzz10
    Avatar
    Community Member
    786 Posts

    Re: Banners on silverstripe Link to this post

    Hmmm... weird... Never had that before...

    Try to place it in a CDATA block...

    e.g. :

    <script>
    <![CDATA[

    your script here ....
    ]]>
    </script>

    2882 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.