More in this section

Forums / Developing with Sitefinity / relative path in Generic Content control

relative path in Generic Content control

2 posts, 0 answered
  1. Jason
    Jason avatar
    4 posts
    23 Jul 2010
    07 Jan 2011
    Link to this post

    In multiple places I have added a Generic Content control and in the html editor have added relative paths. I can save and publish it and everything looks and works correctly. If I go back into it to edit, instead of showing the relative path, it has an absolute path and an sfref with the relative path. If I save it a second time the relative paths stop working.

    Original: <a runat="server" href="~/default.aspx"><img runat="server" src="~/images/image.jpg" alt="image" /></a>

    After being saved: <a sfref="~/default.aspx" runat="server" href="/Website/default.aspx"><img sfref="~/images/image.jpg" runat="server" href="/Website/images/image.jpg" alt="image" /></a>

    The workaround I have found is that everytime I edit the Generic Content I have to change all the "/Website" back to "~". For some pages this is very lengthy and problematic.

    This is also a problem with News modules.

    Is there a way to use relative paths but not have the editor change them?

    Thank You,

    Sitefinity 3.7.2096.2:1

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    10 Jan 2011
    Link to this post
    Hello Jason,

    The sfref is added by our LinkParser and this tag should not break the img link.  There are fixes to the LinkParser in SP4 and I suggest that you should upgrade your project .

    Kind regards,
    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