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

Forums / General Discussions / Changing internal link paths

Changing internal link paths

4 posts, 0 answered
  1. Tristan
    Tristan avatar
    22 posts
    Registered:
    30 Mar 2009
    29 Oct 2010
    Link to this post
    I was just wondering if it's possible to change the way the content editor deals with sitefinity links?
    At the moment it just uses [sitefinity]guid...
    What I want to be able to do is attach the full site url at the start so it's not a relative path. Normally it wouldn't be an issue but we are using url re-writes to make the urls more seo friendly.

    for example we originally had: "http://ourdomain.com/results.aspx?id=111"
    we've now used a re-write to make it: "http://ourdomain.com/range/page111" which of course changes the relative path.

    Does anyone have any ideas?

    Thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    29 Oct 2010
    Link to this post
    Hi Tristan,

    You have to disable our custom - LinkManager what uses dynamic links and use the default one that comes with RadEditor control. In this case you need to implement your own dialog that gets the SiteMap pages and returns only the full path url( similar to WebUITypeEditor)

    An easiest option is modifying \Sitefinity\Admin\ControlTemplates\Pages\Dialogs\PagesSelector.ascx and its insertLink() function where you can change the closeArgument of the dialog and return the absolute path. In this case you do not need a custom dialog.

    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
  3. Tristan
    Tristan avatar
    22 posts
    Registered:
    30 Mar 2009
    01 Nov 2010
    Link to this post
    Hi Ivan,

    I understand a bit more about what is going on under the hood here and doesn't relate to the URL Rewriting we are performing. We have created custom user controls that display Generic Content Items based on some business rules... Basically we are using GetContent() from a ContentManager instance to pull out a specific Content Item, we are then appending the HTML String from IContent.Content into a HtmlGeneric Control... And this works fine...

    However Internal Links stored within the Generic Content are output to the browser as [sitefinity]guid instead of the resolved URL Paths... I assume this is because we are bypassing a process that Generic Content Items would normally render through...

    Does sitefinity expose a method that will run this process over the IContent.Content property or will we have to write a regex to parse out each internal link and feed each through some resolver?

    Thanks
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    01 Nov 2010
    Link to this post
    Hi Tristan,

    You should resolve the links manually

    string text = "content of my control;
    text = LinkParser.ResolveLinks(text, ContentManager.ResolveItemUrl, null, false, false);

    or using this way resolving the url of dynamic links

    Sincerely yours,
    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
Register for webinar
4 posts, 0 answered