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

Forums / General Discussions / News Module Custom Link

News Module Custom Link

3 posts, 0 answered
  1. epozitif.com.tr
    epozitif.com.tr avatar
    2 posts
    Registered:
    07 Jun 2010
    26 Jul 2010
    Link to this post
    I want to customize "full story" link in news module. Can i link to external website in admin panel for some news ?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    26 Jul 2010
    Link to this post
    Hi ozgur,

    1. Create a new metakey that will be used to replace the full story NavigateUrl value - In UserManual page 219 there is a sample and steps by step explanation how to create and use custom metakeys.

    2. Create a custom control that inherits from NewsView and override SetItemContent method. There find the full story link and set it to your custom metakey. The value of the metakey should contain the page you want to be used when you click on "full story"

    sample code

    protected override void SetItemContent(Control itemContainer, IContent contentItem)
      {
          base.SetItemContent(itemContainer, contentItem);
     
              for (int i = 1; i < 6; i++)
              {
                 var  ctrl = FindContentViewControl("fullContent" + i, itemContainer);
                  if (ctrl is HyperLink)
                  {
                      ((HyperLink)ctrl).NavigateUrl = contentItem.GetMetaData("YOUR CUSTOM KEY").ToString();
                  }
              }
                       
      }


    All the best,
    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. epozitif.com.tr
    epozitif.com.tr avatar
    2 posts
    Registered:
    07 Jun 2010
    29 Jul 2010
    Link to this post
    super, thanks :)
Register for webinar
3 posts, 0 answered