More in this section

Forums / Developing with Sitefinity / How to add title/tooltip to news title?

How to add title/tooltip to news title?

3 posts, 0 answered
  1. sathiyaseelan
    sathiyaseelan avatar
    82 posts
    Registered:
    26 Aug 2008
    08 Jun 2010
    Link to this post
    Hi sir,

    I am using default sitefinity 3.7 news manager. I want to show title/tooltip for the news title when we mouse over the news title link.

    Can it be possible to achieve this.

    Thanks,
    sathiya
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    08 Jun 2010
    Link to this post
    Hello sathiyaseelan,

    Thank you for using our services.

    This can be achieved. I would first advise you to take a look a this KB article: How to map a view to an external template, in Sitefinity 3.6 or later? You should first download the external templates archive from your Client.NET account. Then you should map the external templates for NewsView:
    <viewSettings hostType="Telerik.News.WebControls.NewsView">
      <additionalTemplates>
        <!--Provides user interface for displaying a list of news items in the NewsView control for the News module.-->
        <add key="ItemListTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/News/ListPageMaster.ascx" />
        <!--Provides user interface for displaying a single news item in the NewsView control of the News module.-->
        <add key="SingleItemTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/News/ListPageDetails.ascx" />
      </additionalTemplates>
    </viewSettings>

    Then you should edit those templates depending on which view you want to show the tool tip in - list mode or single mode. For list mode you can add the bellow server side code:
    <script type="text/C#" runat="server">
        protected void Page_Load()
        {
            repeater.ItemDataBound += new RepeaterItemEventHandler(repeater_ItemDataBound);
        }
     
        void repeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                HyperLink fullContent1 = (HyperLink)e.Item.FindControl("fullContent1");
                Literal title = (Literal)e.Item.FindControl("Title");
                fullContent1.ToolTip = title.Text;
            }
        }
    </script>

    Save the template and restart the website.

    Sincerely yours,
    Radoslav Georgiev
    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. sathiyaseelan
    sathiyaseelan avatar
    82 posts
    Registered:
    26 Aug 2008
    08 Jun 2010
    Link to this post
    Hi sir,

    Thanks for your quick reply...

    regards,
    sathiya
Register for webinar
3 posts, 0 answered