More in this section

Forums / Developing with Sitefinity / LinksEditorDialog Not Recognising Attribute

LinksEditorDialog Not Recognising Attribute

2 posts, 0 answered
  1. Jodie
    Jodie avatar
    59 posts
    Registered:
    09 Oct 2012
    09 Sep 2009
    Link to this post
    Hi All,

    I have edited the LinksEditorDialog to show a link in a popup window. While in the generic content window I can insert link make it a popup save the link dialog and the html renders as expected in the generic content editor. Then when I select the link again and open the link editor it shows me the properties correctly and my tick box for the popup is selected. However after the generic content window is saved and reopened, selecting the link and opening the linkeditor does not show any properties at all.

    Code for link editor:

    "HTML"

    <

     

    asp:Label ID="Label4" runat="server" Text="Open in pop-up window" ></asp:Label><br />

     

     

    <asp:CheckBox runat="server" ID="OpenAsPopUp" Text="" />

     


    "function Initdialog"

    popupwin = document.getElementById(

    '<%= OpenAsPopUp.ClientID %>')

     

     

    if (currentElement.attributes["class"].value != "" && currentElement.attributes["class"].value == "thickbox") {

     

    popupwin.checked =

    true;

     

    }


    "function insertlink"

    popupwin = document.getElementById(

    '<%= OpenAsPopUp.ClientID %>');

     

     

    if (popupwin.checked) {

     

    closeArgument.setAttribute(

    "class", "thickbox");;

     

    }

     

    else {

     

    closeArgument.setAttribute(

    "class", "");

     

    }


    Any ideas?

    Any help is appreciated :)

    Thanks, Jodie
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    14 Sep 2009
    Link to this post
    Hi Jodie,

    Thank you for using our services.

    Have you taken a look at How to extend the custom RadEditor dialogs KB Article. It provides the logic for adding a check box which when checked will open the link in new window. It uses the target property of the link.

    I have taken a look at the java script you have sent and it look as it should be. I have also added it to my links dialogues and it saves the class attribute. Then i have saved the Generic Content control, published the page, and went back to edit mode. The class attribute was recognized and check box was ticked. Only thing I could notice in your java script was that you have double ; on one of the lines, which actually does not break it:
    if (popupwin.checked) {  
            closeArgument.setAttribute("class""thickbox"); 
       } 
    else { 
           closeArgument.setAttribute("class""");; 
       } 

    Is there any chance that you have some conflicting classes in your CSS that would prevent the if statement when you load the window to fail:
    if (currentElement.attributes["class"].value != "" && currentElement.attributes["class"].value == "thickbox")  
           { 
               popupwin.checked =true
           } 

    This would be the reason that I could think why the check box gets not checked.

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered