Absolute URLs for images

Last post 10-07-2008, 4:38 AM by Kenneth. 5 replies.
Sort Posts: Previous Next
  •  10-03-2008, 4:21 PM 44547

    Absolute URLs for images

    Hello,
     
    I have the cute editor installed for a Dot Net nuke applacation.  I need to have the src in the <IMG> tags to be absolute. like this
    <img height="306" alt="" src="http://localhost/LocalDNN/Portals/6/ufonaut.gif" width="254" border="0" />
     
    But what is happening is something like this
    <img height="306" alt="" src="http://cutesoft.net/Portals/6/ufonaut.gif" width="254" border="0" />
     
    I have read a some threads on these boards and have found a lot of discussion.  Here is an example of my aspx file :
    <%@ Register TagPrefix="dnn" TagName="TextEditor" Src="~/controls/TextEditor.ascx"%>
     ...
     <dnn:TextEditor
                            id="EditorImageLogo"
                            runat="server"
                            width="100%"
                            height="500"
                            URLType="Absolute"
                            RemoveServerNamesFromUrl="false"
                            UseRelativeLinks="false"></dnn:TextEditor>
     
     
    Visual Studio says "is not a valid attribute of elenemt TextEditor" about the three items I underlined and red.  I tried all combos of the three, like just URLType by itself and then all three.  But Visual studio does not like them.
     
    I made this change in my web.config file
    URLType="Absolute"

    This did fix my personal enviroment with this change.  It's working like a dream cause of the web.config.
     
    BUT here is the rub.  Changing the web.config from URLType="Default" on or DEV and LIVE servers is not an option :-(
     
    any advice on how I can do this?
  •  10-05-2008, 1:44 AM 44560 in reply to 44547

    Re: Absolute URLs for images

    Hi DarkStar,
     
    Please use the following property:

    Editor.URLType Property
    When you're creating links to documents and images on the Web, you need to think about how you're going to link to them. CuteEditor supports three standard ways to create links:
    1. Site root relative path ( <a href="http://cutesoft.net/default.aspx">Home</a> )
    2. Absolute path ( <a href="http://cutesoft/default.aspx">Home</a> )
    3. Relative paths ( <a href="default.aspx">Home</a> or <a href="#top">Top</a>)  
    Code Example:

    <%@ Page Language="C#" %>
    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <script runat="server">

    </script>

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        <CE:Editor ID=editor1 runat=server URLType="Absolute"></CE:Editor>
        </div>
        </form>
    </body>
    </html>
     
    Demo:
    Regards
     
    Ken
  •  10-06-2008, 8:08 AM 44619 in reply to 44560

    Re: Absolute URLs for images

    Thanks Ken!
     
    I made those changes and all seems well save for one thing.  I tested just typing text in the editors and some basic formatting things.  Those seem to work OK.  However when I select the image gallery I get the following error.
     

    Server Error in '/LocalDNN' Application.

    Could not find a part of the path 'c:"inetpub"wwwroot"LocalDNN"uploads'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'c:"inetpub"wwwroot"LocalDNN"uploads'.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [DirectoryNotFoundException: Could not find a part of the path 'c:"inetpub"wwwroot"LocalDNN"uploads'.]
    System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +492
    System.IO.Directory.InternalGetFileDirectoryNames(String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, SearchOption searchOption) +1559
    System.IO.Directory.GetDirectories(String path, String searchPattern, SearchOption searchOption) +37
    System.IO.Directory.GetDirectories(String path) +11
    CuteEditor.Impl.FileSystemStorage.GetDirectoryItems(String dirpath, Boolean getcount) +87
    CuteEditor.Dialogs.InsertGalleryFrame.b() +541
    CuteEditor.Dialogs.InsertGalleryFrame.OnLoad(EventArgs e) +17
    System.Web.UI.Control.LoadRecursive() +47
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436


    Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433 
     
     
    I'm sure it's a web config setting or something so I'll explore that.  But I'm not sure so if you could point me in the right direction that would be awesome.
     
     I have tried changing UseDNNRootImageDirectory="true" to UseDNNRootImageDirectory="false" already but that did not work.
     
    Thanks!
  •  10-06-2008, 8:14 AM 44620 in reply to 44547

    Re: Absolute URLs for images

    Oh sorry I should mention,
     
    What I need is for the image gallery to find the specific portal's image folder.
     
    Here is an example from my machine. .
     
     
    C:/Inetpub/wwwroot/LocalDNN/Portal/0
    C:/Inetpub/wwwroot/LocalDNN/Portal/1
    C:/Inetpub/wwwroot/LocalDNN/Portal/3
    C:/Inetpub/wwwroot/LocalDNN/Portal/4
    C:/Inetpub/wwwroot/LocalDNN/Portal/5
    C:/Inetpub/wwwroot/LocalDNN/Portal/6

    Thanks again
  •  10-06-2008, 9:45 AM 44626 in reply to 44620

    Re: Absolute URLs for images

    In the Cute Editor section of DNN web.config field, set  UseDNNRootImageDirectory="true".

    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

  •  10-07-2008, 4:38 AM 44652 in reply to 44547

    Re: Absolute URLs for images

    hi
View as RSS news feed in XML