Relative links, Absolute links, Default links - not getting correct links on images unless modify the HTML

Last post 09-16-2008, 10:19 PM by arpdan. 3 replies.
Sort Posts: Previous Next
  •  09-12-2008, 2:36 PM 43900

    Relative links, Absolute links, Default links - not getting correct links on images unless modify the HTML

    I am using CuteEditor 6.0 for ASP.
     
    I have set up the editor with a folder inside of CuteEditor_files called 'userimages' where I place all of the images to be used in the editor.  The page that I am modifying with the editor sits one folder (PageFolder) closer to the root folder:
    root/.../Folder1/PageFolder/CuteEditor_files/userimages
    In the page where I use the editor I have included a path to the userimages folder - editor.ImageGalleryPath = "../userimages/" which works beautifully and all of the images are coming up when I use the editor tool bar for inserting an image or looking at the image gallery.  However, when I select an image and insert it into the editor the image is not visible no matter what value I use for editorURLType.  For all instances the link created points to the wrong folder.
     
    For the siteRelative setting it gives me "/root/...Folder1/userimages/" as the path.
     
    For the Absolute setting it gives me "http://domainname.com/../Folder1/userimages/" as the path.
     
    For the Default setting it gives me "../userimages/" as the path.
     
    Essentially, even though the Image Gallery and the Insert Image tool have no problem finding the graphics, when the image is inserted into the page it does not have the correct path no matter what I do and I have to manually change the HTML to get it correct.  I've had to make the editor.ImageGalleryPath a ../ type path because the popup windows need to move back a folder to get the image.  But it seems that this ../ path is causing the editor itself to back up 2 folders when generating the path to the image. 
     
    Is there some other setting that I can use that applies to just the editor and not to the popup windows?
     
    Any suggestiong would be appreciated.
  •  09-12-2008, 2:51 PM 43901 in reply to 43900

    Re: Relative links, Absolute links, Default links - not getting correct links on images unless modify the HTML

    Please use the absolute path instead of the relative path:

    editor.ImageGalleryPath = "/images"

     
    It should fix the issue.

    Keep me posted
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  09-12-2008, 4:44 PM 43904 in reply to 43901

    Re: Relative links, Absolute links, Default links - not getting correct links on images unless modify the HTML

    Your solution solves the problem of the images being accessible thru the imagae gallery and thru the insert image and also on the WYSIWYG.  However, it makes the default URLType entirely useless since it has exactly the same effect as the SiteRelative setting. This causes me problems.
     
    I'm currently working in a testing environment with the following path structure:
     
    The live environment will have the following path structure:
     
    I have added code to set the value of editor.ImageGalleryPath dynamically so that during testing the path includes the 'testFolder' folder in the path
    /testFolder/../Folder1/PageFolder/CuteEditor_files/userimages/
    and once we turn live this path will automatically change and eliminate the 'testFolder'
    /../Folder1/PageFolder/CuteEditor_files/userimages/
    But that won't change all of the links that were generated during the testing phase that  have 'testFolder' in them.  That was one of the reasons that we upgraded to Cute Editor 6.0 - because of the relative link feature. Our client will be loading a lot of content using the WYSIWYG during the testing phase and with the solution that you are suggesting we will have to go thru the database the day we cutover and change all of the links.  This will mean that their site will have to down for several hours while we make this change AND it will open up the chance of typos when making the change.  So instead of going live with completely tested content we would be going live with content that had to be tested all over again. Not a pleasant thought.
     
    So, although the solution you have suggested works, it eliminates any use I could get from setting the URLType = default which would make the code AND the database content completely transportable.
     
    If you  have any suggestions on how I could get the images to work for the Image Gallery, the Insert Image, the WYSIWYG and still be transportable by not having to use the SiteRelative setting or the equivalent link that is now being generated using the Default setting, I would appreciate it.
  •  09-16-2008, 10:19 PM 43996 in reply to 43901

    Re: Relative links, Absolute links, Default links - not getting correct links on images unless modify the HTML

    It seems that this problem of relative links being useless carries over to the use of templates as well.  If you have a template and that template has place holder images in it then the following problem occurs. When you go to insert the template and view the thumbnail of it, if you have relative links set appropriately in the template they show very nicely in the thumbnail.  However, when you insert the thumbnail into the WYSIWYG the relative links for the place holder images are no longer correct and the images show as being missing.  If you adjust the template so that they work inside of the WYSIWYG then they don't show properly in the thumbnail.  The only way to make them work both places is to use absolute or site relevant paths for both the editor settings and in the template itself.
     
    When you get right down to it the only place that you can use relative links is if you modify the HTML directly. The WYSIWYG does not modify them as it did in older versions.  Other than that relative links just don't seem to be useable. 
     
    If you know a way around this that allows the use of relative links inside of templates or for images (and I assume also for documents or anything else that you insert) please let me know. 
     
    If this is on a list of future enhancements I would also appreciate knowing that.
     
     
View as RSS news feed in XML