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

Forums / Developing with Sitefinity / Selecting friendly URL in image properties

Selecting friendly URL in image properties

2 posts, 0 answered
  1. IT
    IT avatar
    52 posts
    Registered:
    30 Sep 2008
    01 May 2009
    Link to this post
    I've added a couple properties to the library images (Description, LinkToURL) and I'm able to read them in a custom control. Simple, but good stuff. What I want to do is have the property for LinkToURL (in edit mode) open a div with the site tree to allow users to select the page and store that page in the property.  I suppose it might make even more sense to use the GUID for the page (or whatever you use internally) so that chaning the location of the page in the sitemap won't break the link.

    Currently users just navigate to the page and copy/paste in the URL and remove the domain information (as we have a different environment for test and production).

    I started looking at the UrlPicker tree control and was making a little headway, but figured I should ask before going too far down a road that might work but not be the most effective way of doing it. Is anyone doing something similar to this?

    Thanks!
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    01 May 2009
    Link to this post
    Hello Stormy,

    You can use CmsHyperLinkUrlWebEditor which returns a guid of a selected page:

        //select page id selector 
        [WebEditor("Telerik.Cms.Web.UI.CmsHyperLinkUrlWebEditor, Telerik.Cms")] 
        public string TargetCmsPageID 
        { 
            get 
     
            { 
               return this.targetCmsPageID; 
            } 
            set 
            { 
                this.targetCmsPageID = value; 
            } 
        } 
        private string targetCmsPageID; 
     

    I hope this helps.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
2 posts, 0 answered