More in this section

Forums / Developing with Sitefinity / News thumbnail

News thumbnail

2 posts, 0 answered
  1. Andrej Kaurin
    Andrej Kaurin avatar
    5 posts
    Registered:
    14 Mar 2007
    02 Jul 2009
    Link to this post
    In new version of Sitefinity News Thumbnail when referencing to image library item has value like
    "[Libraries]83a6efe7-f055-4d2b-b4e5-0e409e84290b".
    How to display such image in custom template? I can't find any documentation regarding to that issue.
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    02 Jul 2009
    Link to this post
    Hello Kaan,

    We use this format for our dynamic links to content items. This way we produce unbreakable links (the links is resolved by id, rather than paths). You can use the following function to resolve such items' urls:
            public string GetItemUrl(string provider, Guid id, bool resolveAsAbsoluteUrl)  
            {  
                if (ContentManager.Providers.ContainsKey(provider))  
                {  
                    IContent cnt = ContentManager.Providers[provider].GetContent(id);  
                    if (cnt != null)  
                        return VirtualPathUtility.ToAbsolute(cnt.UrlWithExtension, this.Context.Request.ApplicationPath);  
                }  
                else  
                {  
                    string url = CmsHelper.GetPageUrl(id );  
                    if (!string.IsNullOrEmpty(url))  
                    {  
                        return url;  
                    }  
                }  
                return String.Concat("Item not found: [", provider, "]", id);  
            }  

    I hope this helps.

    Greetings,
    Georgi
    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