Hi,
I am currently using the CMSContent plugin that i found on sourceforge to create links in my little app.
(for those who dont know the plugin... it is a plugin that enables you to link to content from a database)
My problem is that when i use an image for the link it breaks the image and returns an undefined string.
Can anyone advise how i would make it allow for images IE = the <img> tag ?
Thanks
I am currently using the CMSContent plugin that i found on sourceforge to create links in my little app.
(for those who dont know the plugin... it is a plugin that enables you to link to content from a database)
My problem is that when i use an image for the link it breaks the image and returns an undefined string.
Can anyone advise how i would make it allow for images IE = the <img> tag ?
Thanks
<script type="text/javascript"> <!-- var oEditor = window.parent.InnerDialogLoaded(); var FCK = oEditor.FCK; var FCKLang = oEditor.FCKLang ; var FCKConfig = oEditor.FCKConfig ; var FCKCMSContent = oEditor.FCKCMSContent; // oLink: The actual selected link in the editor. var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ; if ( oLink ) FCK.Selection.SelectNode( oLink ) ; window.onload = function () { // First of all, translates the dialog box texts. oEditor.FCKLanguageManager.TranslatePage(document); LoadSelected(); //See function below window.parent.SetOkButton( true ); //Show the "Ok" button. } //If an anchor (A) object is currently selected, load the properties into the dialog function LoadSelected() { var sSelected; if ( oEditor.FCKBrowserInfo.IsGecko ) { sSelected = FCK.EditorWindow.getSelection(); alert(sSelected); } else { sSelected = FCK.EditorDocument.selection.createRange().text; } if ( sSelected == "" ) { alert( 'Please select the required item to create a link to.' ); } } //Code that runs after the OK button is clicked function Ok() { //Validate is option is selected var oPageList = document.getElementById( 'cmbPages' ) ; if(oPageList.selectedIndex == -1) { alert('Please select a page in order to create a link'); return false; } var oTagLink = document.getElementById( 'chkTaglink' ); if (oTagLink.checked) { //Create special CMS tag var sSelected; if ( oEditor.FCKBrowserInfo.IsGecko ) { sSelected = FCK.EditorWindow.getSelection(); } else { sSelected = FCK.EditorDocument.selection.createRange().text; } var sPageId = oPageList[oPageList.selectedIndex].value; var sTagOutput = "<a href='" + sPageId + "'>" + sSelected + "</a>"; oEditor.FCK.InsertHtml( sTagOutput ); } else { var sURL = document.getElementById( 'PageURL' ) ; var sPageId = oPageList[oPageList.selectedIndex].value; oLink = oEditor.FCK.CreateLink( sURL.value + sPageId ) ; SetAttribute( oLink, 'title' , document.getElementById( 'txtTitle' ).value ) ; } return true; } //--> </script>