Jump to:

23369 Posts in 18155 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » Add This Code

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 519 Views
  • Lemonie
    Avatar
    Community Member
    70 Posts

    Add This Code Link to this post

    I am trying to add the following 'add this' code to my website but it isn't showing. Have tried putting it in <p></p> which has worked with other codes in the past?

    <!-- AddThis Button BEGIN -->
    <div class="addthis_toolbox addthis_default_style addthis_32x32_style">
    <a class="addthis_button_facebook"></a>
    <a class="addthis_button_tweet"></a>
    <a class="addthis_button_email"></a>
    <a class="addthis_button_print"></a>
    <a class="addthis_button_compact"></a>
    </div>
    <script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
    <script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-506c7b45025956c0"></script>
    <!-- AddThis Button END -->

  • Nobrainer Web
    Avatar
    Community Member
    134 Posts

    Re: Add This Code Link to this post

    a little info about where you add the code and such, would be helpfull.

    remember to add ?flush=1 to the URL when making changes to template files - this forces SS not to use cached files.

  • Lemonie
    Avatar
    Community Member
    70 Posts

    Re: Add This Code Link to this post

    Hi

    I want to add this directly to a web page.

    Thanks

  • Nobrainer Web
    Avatar
    Community Member
    134 Posts

    Re: Add This Code Link to this post

    If you are trying to add the code in the TinyMCE editor, i guess the script tags will be stripped out.
    Try having a look at the source code, what is actually coming out from the editor.

    I think you should add the code to your template file instead.

    Another option is to create a simple Textarea (without editor) and output the in the template.

  • Neelam
    Avatar
    Community Member
    15 Posts

    Re: Add This Code Link to this post

    But tinymce can be configured to allow script as well right....?? I have tried it by adding HtmlEditorConfig::get('cms')->setOptions(array(
    'extended_valid_elements' => "*

    • "
      ));

      to mysite/_config.php...but script tags are getting stripped...any idea where this is happening?

  • edwardlewis
    Avatar
    Community Member
    32 Posts

    Re: Add This Code Link to this post

    I would create a new text area field and drop the code in there.. or put it directly into the page template

    519 Views
Page: 1
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.