Try Now
More in this section

Forums / Developing with Sitefinity / Add title to inserted image

Add title to inserted image

2 posts, 0 answered
  1. Ancuta Me
    Ancuta Me avatar
    43 posts
    26 Apr 2010
    27 Oct 2010
    Link to this post

    Could anyone share how to add a title field to go to my inserted images?
    I can't seem to find the template that deals with images added from the radEditor.

    Thank you.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    25 Oct 2016
    27 Oct 2010
    Link to this post
    Hello Ancuta,

    The built-in selector does not return the title as argument of the RadWindow control that we use. You can modify Sitefinity\Admin\ControlTemplates\Libraries\Dialogs\ImageEditorDialog.ascx and insertLink() function as shown below to get the image title.

    function insertLink() //fires when the Insert Link button is clicked
        var closeArgument = currentElement;
        selValue = document.getElementById('<%= selectedValueField.ClientID %>')
        editHolder = document.getElementById('<%= editHolder.ClientID %>');
        var uplImg = document.getElementById('<%= uploadedImage.ClientID %>');
        if (editHolder.style.display == 'none') {
            if (selectedItem)
                closeArgument.alt = selectedItem.altText;
                closeArgument.alt = '';
            closeArgument.src = selValue.value;
        else {
            var altTextTxt = document.getElementById('<%= altTxt.ClientID %>');
            closeArgument.src = selValue.value;
            if (altTextTxt)
                closeArgument.alt = altTextTxt.value;
        if (selValue.value.indexOf("~/") == 0) {
            closeArgument.setAttribute("sfref", selValue.value);
        } else if (selectedItem != undefined && selectedItem.unresolved) {
            closeArgument.setAttribute("sfref", selectedItem.unresolved);
            closeArgument.setAttribute("width", "100");
            closeArgument.setAttribute("height", "100");
        } else if (uplImg != undefined && uplImg.attributes["sfref"] != undefined) {
            closeArgument.setAttribute("sfref", uplImg.attributes["sfref"].value);
            var imgSrc = uplImg.src;
            if (imgSrc.indexOf("?") < 0) {
                closeArgument.src = imgSrc;
                closeArgument.src = imgSrc.slice(0, imgSrc.indexOf("?"));
        } else {
        closeArgument.title = closeArgument.nameProp;
        if (getRadWindow()) {
            var radWindow = getRadWindow();
            radWindow.argument = closeArgument;
            radWindow.close(closeArgument); //use the close function of the getRadWindow to close the dialog and pass the arguments from the dialog to the callback function on the main page.

    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
2 posts, 0 answered