+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Absolute link paths on list items

Absolute link paths on list items

8 posts, 0 answered
  1. Vangelis
    Vangelis avatar
    153 posts
    Registered:
    07 Jan 2006
    11 Jul 2007
    Link to this post
    Hi,

    I created a list with items pointing to files as downloadable links. What I have noticed is that there is no way of creating absolute paths ex ../files/folder/file.zip

    While on select an image the src is /project_name/sitefinity/files/folder/file.zip 
    on save it converts to
    http://localhost/project_name/sitefinity/files/folder/file.zip 

    Also how can I nable number and bullet list on toolbar and allow also add files as it is on generic content toolbar?

    Best regards

    Vagelis
  2. Vangelis
    Vangelis avatar
    153 posts
    Registered:
    07 Jan 2006
    11 Jul 2007
    Link to this post
    I found in some other post that I have to include ~/ for absolute path.
  3. Vangelis
    Vangelis avatar
    153 posts
    Registered:
    07 Jan 2006
    11 Jul 2007
    Link to this post
    There is some link error when there is a page which has been declared as page group . It adds page name and after the path so it points to a not valid location.

    http://localhost/project_name/pagegroupname/~/files/folder1/apofaseis_ds_2003.zip

    The correct one would be 

    http://localhost/project_name/files/folder1/apofaseis_ds_2003.zip

    Any suggestion?

    Best regards

    Vagelis
  4. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    13 Jul 2007
    Link to this post
    Hi Vagelis,

    Unfortunately we don't understand your scenario of using a list of downloadable links. Is it a UserControl or you are adding hyper links with RadEditor?

    However in case you want to have URL paths resolved on the server in your application, you could use a server link control, e.g.:

    <asp:HyperLink ID="link1" runat="server" NavigateUrl="~/files/folder1/apofaseis_ds_2003.zip">Link1</asp:HyperLink>

    Please, let us know if we are missing something.

    Best wishes,
    Vlad
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Vangelis
    Vangelis avatar
    153 posts
    Registered:
    07 Jan 2006
    13 Jul 2007
    Link to this post
    Hi Vlad,

    Let me explain my scenario o fusing downloadble files in a list module. I have municipality decisions (files) which are separated in years - months so I want to add a list for ex 2005 and opening it will have Jan (pointing to a file) for someone to download it.

    In navigation menu this belongs on a page group

    decisions  (with name decisions.aspx)
                  ----- > Council  (council.aspc)
                  ----- > Mayor's  (mayors.aspx)


    When I include a file with a link ~/folder/file.pdf

    when I browse the page council.aspx and try to open the file I see that the path has http://localhost/projectname/decisions/folder/file.pdf

    I have't find a way to bypass this since if I write on link ~/../folder/file.pdf then it is convertered to somethning like /telerik/admin/file/folder.pdf.

    I hope the above help you understand my problem.

    Best regards

    Vagelis
  6. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    13 Jul 2007
    Link to this post
    Hello Vagelis,

    Thank you for elaborating about the scenario.
    But I still don't understand where you place the link to the .pdf file? Is it in a ASP.NET control or it is added as an HTML in a generic content?


    All the best,
    Vlad
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. Vangelis
    Vangelis avatar
    153 posts
    Registered:
    07 Jan 2006
    13 Jul 2007
    Link to this post
    Hi Vlad,

    I have created a new list (module lists). There I have added a link to file. I have included this list on a page on the above scenario.

    Best regards

    Vagelis
  8. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    13 Jul 2007
    Link to this post
    Hi Vagelis,

    Actually RadEditor can only work with absolute paths. This behavior is similar to MS Office Word embedded links.
    As for the ASP.NET root operator (~), it wont work for the paths in RadEditor, you can use it only in server controls.

    RadEditor provides two options for storing paths: absolute path (http://..) and rooted path (/..). You can switch between them by changing StripAbsoluteAnchorPaths and StripAbsoluteImagesPaths properties of the RadEditor. If the above properties are set to true it strips the server name from the URL. Also you have an option to strip a desired portion of the URL path specifying it in AnchorPathToStrip and ImagesPathToStrip properties. See this article.

    In the current version of Sitefinity StripAbsoluteAnchorPaths and StripAbsoluteImagesPaths are set to trueand the path is stored without http://. Unfortunately, currently we cannot provide a better configuration of RadEditor. However, we plan to address this issue in some of the next releases. The main problem appears when you move the site from dev server to the live server and in your dev server the project is set as a virtual directory, but in the live server it is set as a Web Site. So all paths /project_name/something should be changed to /something. You can avoid or fix this problem using one of the following approaches:
    • Using a same IIS setting on the dev and live servers, e.g. Web Site on the dev and Web Site on the live server, or Virtual Directory on the dev and Virtual Directory on the live server.
    • Running a script into the database which replaces all paths (see this forum)
    You can find RadEditor settings for editing List Item in the following template 
    /Sitefinity\Admin/ControlTemplates/Lists/ListItemEditorTemplate.ascx

    As you can see in the template, it uses the following editor configuration file:
    ~/Sitefinity/Admin/ControlTemplates/EditorConfigFile.xml

    Also this file is used by all RadEditors in the administration by default.

    As to your second question about missing number and bulleted lists in the RadEditor toolbar in the List Module, you can enable them in its Tools.xml file. It is located in:
    ~/Sitefinity/Admin/ControlTemplates/Lists/ToolsFile.xml

    <tool name="InsertOrderedList" enabled="true" />
    <
    tool name="InsertUnorderedList" enabled="true" />

    Hope this helps.

    Greetings,
    Vlad
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
8 posts, 0 answered