Forums

Skip Navigation LinksHome / Developer Network / Forums / Sitefinity 3.x: Bugs & Issues > 3.5 javascript stripped from generic content

3.5 javascript stripped from generic content

  • Posted on Oct 14, 2008 (permalink)

    I use generic content areas to insert and manage javascript ad code (google ads).  After upgrading the site to 3.5, the javascript is stripped out of the generic content areas even after adding the AllowScripts = True to the controls located here:

    /Sitefinity/Admin/Generic_Content/
    ControlPanelInsert.ascx
    ControlPanelEdit.ascx
    EditorTemplate.ascx

    How can I re-enable the scripts in the generic content areas in Sitefinity 3.5?

    Reply

  • Posted on Oct 14, 2008 (permalink)

    I found the answer here:  

    http://www.telerik.com/help/aspnet-ajax/telerik.web.ui-telerik.web.ui.radeditor-allowscripts.html

    I'm loving this new ContentFilter property!  Good stuff.

    Reply

  • Posted on Oct 14, 2008 (permalink)

    Well the fix I found doesn't seem to be working correctly.  It seems to be ignoring my ContentFilter setting which I have set to None currently.  Is it hard-setting the ContentFilter behind the scenes or am I missing something?

    Reply

  • Posted on Oct 15, 2008 (permalink)

    I did a little more research into the problem and what I have discovered is that the ContentFilters are getting set correctly.  I determined that through the use of this code in the OnClientLoad function:

     
            
    var filter = editor.get_filtersManager();  
    for (var i = 0; i < filter._filters.length; i++)  
    {  
       alert(filter._filters[i].get_name());  

    However, even if I set the ContentFilters property = None and the OnClientLoad shows that the StripScriptsFilter is not included in the filter array, they RichEdit box is still stripping out the Script tags which is killing the google Ad placement.  Is there a different control that should be used for google ads? 

    Reply

  • Nikolai Nikolai admin's avatar

    Posted on Oct 17, 2008 (permalink)

    Hello Adam,

    Unfortunately we discovered this issue shortly after the release of 3.5.
    What you could do is to add JS directly on you .master page or user templates. We will try to provide a fix for this as soon as possible.
    Thank you for your time and understanding.

    Best wishes,
    Nikolay
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

    Reply

  • Shane avatar

    Posted on Oct 18, 2008 (permalink)

    Have you guys ever thought about creating a different control like "Generic Content With Scripts"?   I've shown a half dozen developers the "AllowScripts="true" property.  I think a lot of people are putting javascript in the generic content and it would be easier for people if it was already set to true or a different control they could add.

    Just a thought.

    I am also waiting for your fix on this issue since I use javascript in some of my generic content and can't upgrade until this is fix.

    Do you have any idea how long it might take?

    Thanks for your help,
    Shane

    Reply

  • Georgi Georgi admin's avatar

    Posted on Oct 20, 2008 (permalink)

    Hello Shane,

    Here's some more information about the upcoming fix - Sitefinity 3.5 SP1 to be released soon.

    Greetings,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

    Reply

  • Patrik avatar

    Posted on Feb 26, 2010 (permalink)

    Hi there,

    i'm using version 3.7 SP2 and have the same problem as mentioned above (e.g. with amazon ads and further more). I discovered some browser dependencies. IE, Chrome and Opera are displaying the ads as wanted. There are only missbehaviours with FF. Is there any workaround or something else?

    Best Regards,
    Patrik

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Feb 26, 2010 (permalink)

    Hi Patrik,

    In Sitefinity 3.7 SP2 the RadEditor used withing GenericContent control uses Filters. Make sure that RemoveScripts filter is not enabled.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • Patrik avatar

    Posted on Feb 26, 2010 (permalink)

    Hi Ivan,

    are these filters per default disabled? In due to this, I've made no changes on the generic content control and its properties.

    Best Regards,
    Patrik

    Reply

  • Radoslav Georgiev Radoslav Georgiev admin's avatar

    Posted on Feb 26, 2010 (permalink)

    Hello Patrik,

    Content filters are enabled by default. This forum thread explains clearly what you have to do: http://www.sitefinity.com/support/forums/sitefinity-3-x/bugs-issues/problem-adding-applet-tag-to-generic-content-radeditor.aspx

    Best wishes,
    Radoslav Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • Patrik avatar

    Posted on Feb 26, 2010 (permalink)

    Hi,

    I followed these instructions, but there was no noticeable effect. And it is only Firefox which cause this problem. Are there any possibilities that these filters are browser-sensitive?

    Best Regards,
    Patrik

    Reply

  • Radoslav Georgiev Radoslav Georgiev admin's avatar

    Posted on Feb 26, 2010 (permalink)

    Hello Patrik,

    When you have modified the ~/Sitefinity/Admin/ControlTemplates/Generic_Content/GenericContentDesigner.ascx and map the view settings in the controls config file in ~/App_Data/Configuration did you restart the website? Control configuration mappings do not take effect unless you restart the website. A simple test to see whether your template is the external one is to write some static text in the control template and see if it will appear.

    All the best,
    Radoslav Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • Patrik avatar

    Posted on Feb 26, 2010 (permalink)

    Hi,

    I've executed the iisreset-cmd to enforce the new changes. I've added some static text below the radEditor and it is shown properly. So the right control is being displayed.

    Best Regards,
    Patrik

    Reply

  • Radoslav Georgiev Radoslav Georgiev admin's avatar

    Posted on Feb 26, 2010 (permalink)

    Hi Patrik,

    Could you please show us the java script you are using? I am trying to reproduce this behavior with the changes outlined in linked articles, however to no avail.

    Regards,
    Radoslav Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • Patrik avatar

    Posted on Feb 26, 2010 (permalink)

    Hi,

    for sure. It's an code-snipped to embedd an membership-button of the carrer-portal xing.

    <script type="text/javascript"
    var uri = 'http://impde.tradedoubler.com/imp?type(img)g(18137362)a(1781634)' + new String (Math.random()).substring (2, 11);
    document.write('<a href="http://clkde.tradedoubler.com/click?p=103578&a=1781634&g=18137362" originalAttribute="href" originalPath="http://clkde.tradedoubler.com/click?p=103578&a=1781634&g=18137362" originalAttribute="href" originalPath="http://clkde.tradedoubler.com/click?p=103578&a=1781634&g=18137362" originalAttribute="href"  originalPath="http://clkde.tradedoubler.com/click?p=103578&a=1781634&g=18137362" target="_BLANK"><img src="'+uri+'" originalAttribute="src" originalPath="'+uri+'" originalAttribute="src" originalPath="'+uri+'" originalAttribute="src" originalPath="'+uri+'" originalAttribute="src" originalPath="'+uri+'" originalAttribute="src" originalPath="'+uri+'" border=0></a>');
    </script>

    I have also recognized that the amazon ad which is an iframe also will not be displayed in FF.
    <iframe style="width: 120px; height: 240px;" marginheight="0" src="http://rcm-de.amazon.de/e/cm?t=battl2rhinefi-21&;o=3&p=8&l=as1&asins=0672330229&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" frameborder="0" marginwidth="0" scrolling="no"></iframe>

    Best Regards,
    Patrik

    Reply

  • Radoslav Georgiev Radoslav Georgiev admin's avatar

    Posted on Feb 26, 2010 (permalink)

    Hi Patrik,

    I have tried the script you have provided and the result is attached. This is the Markup of my editor:
    <telerik:RadEditor
    runat="server"
    ID="textEditor"
    ContentAreaCssFile="~/Sitefinity/Admin/Themes/Default/AjaxControlsSkins/Sitefinity/EditorContentArea.css"
    ToolsFile="~/Sitefinity/Admin/ControlTemplates/EditorToolsFile.xml"   
    Skin="WebBlue"   
    NewLineBr="False"
    Height="360px"
    Width="98%"
    AllowScripts="true"
    ContentFilters="None"
    StripFormattingOnPaste="MSWordRemoveAll">
    <ImageManager ViewPaths="~/Images" UploadPaths="~/Images" DeletePaths="~/Images" />
    <MediaManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" />
    <FlashManager UploadPaths="~/Files" DeletePaths="~/Files" ViewPaths="~/Files" />
    <DocumentManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" />
    <CssFiles>
    <telerik:EditorCssFile Value="~/Sitefinity/Admin/Themes/Default/AjaxControlsSkins/Sitefinity/EditorCssFile.css" />
    </CssFiles>        
    </telerik:RadEditor>

    Please note that this script will be executed each time you edit the content item, thus writing more and more buttons. 

    You could try to wrap the script in a simple user control and add it as a control in the toolbox.

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
    Attached files

    Reply

  • Patrik avatar

    Posted on Feb 26, 2010 (permalink)

    Hi,

    there is another "fascinating" error. After mapping to the external control my text above the javascript-buttons will not be displayed in editing mode, only the button. When I'm using the assembled control the text will be displayed instead of the button.

    Best Regards,
    Patrik

    Reply

  • Register for webinar
Skip Navigation LinksHome / Developer Network / Forums / Sitefinity 3.x: Bugs & Issues > 3.5 javascript stripped from generic content