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

Blog Links

4 posts, 0 answered
  1. Steven Lancaster
    Steven Lancaster avatar
    82 posts
    Registered:
    06 Nov 2009
    08 Jan 2010
    Link to this post
    I have a page that I have a blog in. I want to change the URL of the read more or the blog title to go to a another page I have created. So to explain a little better


    BLOG:

    This is a Blog - (Change URL to different page)

    jlkjkj asdjkajskf ;ajfkjksfj asfkjksf ;ajkfjsakf lkjkljksaf....
    read more-(Change URL to different page)


    Is there a way to easily do this. I know the Blog is a dynamic page that is created on the fly, but I really want the links to be static.



  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    08 Jan 2010
    Link to this post
    Hello Steven Lancaster,

    Create a custom class that inherits from BlogPosts. Override SetItemContent method. Find the HyperLink with ID = "fullcontent1". Then you can change the NavigateUrl to each content object to the desired desctination.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Steven Lancaster
    Steven Lancaster avatar
    82 posts
    Registered:
    06 Nov 2009
    08 Jan 2010
    Link to this post
    Can you  give me a sample of "Create a custom class that inherits from BlogPosts. Override SetItemContent method"?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    08 Jan 2010
    Link to this post
    Hello Steven Lancaster,

    Below is a sample code that demonstrates desired logic :

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using Telerik.Blogs.WebControls;
    using System.Web.UI;
    using System.Web.UI.WebControls;
     
    /// <summary>
    /// Summary description for BlogPostsCustomControlSample
    /// </summary>
    public class BlogPostsCustomControlSample : BlogPosts
    {
        public BlogPostsCustomControlSample()
        {
      
        }
     
        public override string ItemListTemplatePath
        {
            get
            {
                return "RETURN YOUR PATH THERE";
            }
     
        }
     
        public override string SingleItemTemplatePath
        {
            get
            {
                return "RETURN YOUR PATH THERE";
            }
        }
     
        protected override void SetItemContent(System.Web.UI.Control itemContainer, Telerik.Cms.Engine.IContent contentItem)
        {
            base.SetItemContent(itemContainer, contentItem);
            Control ctrl = FindContentViewControl("content", itemContainer);
              ctrl = FindContentViewControl("fullContent1", itemContainer);
              string navUrl = "http://www.sitefinity.com";
     
              if (ctrl is HyperLink)
              {
                  ((HyperLink)ctrl).NavigateUrl = navUrl;
              }
     
        }
    }

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
4 posts, 0 answered