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

Forums / Developing with Sitefinity / How to disable Hyperlink from News Title

How to disable Hyperlink from News Title

7 posts, 0 answered
  1. praveen
    praveen avatar
    11 posts
    Registered:
    02 Aug 2010
    10 Jan 2011
    Link to this post
    Hi,

    I am using News View control in 2 different pages. In first page Hyperlink should work for all news items titles. But in second page while showing all news item I don't want to show news titles as Hyperlink. I just want to show TITLE as a Plain Text.

    Now I am working with External Templates to do this. Actuvally I created one more check box option in NewsViewControlDesigner.ascx  file like:

    <sfDesignSettings:TextSetting ID="TextSetting15"
                                                  TargetID="Title1"
                                                  SettingTitle="Title, Not linking to the full article"
                                                  AllowLabelSetting="False"
                                                  AllowFormatSetting="False"
                                                  AllowVisibilitySetting="True"
                                                  TargetVisibleByDefault="True" Enabled="False">
                        </sfDesignSettings:TextSetting>

    And also I created a Literal in ListPageMaster.ascx file like:

    <h2 class="sf_newsTitle">
                                     <asp:Literal ID="Title1" runat="server" ></asp:Literal>
      </h2> 

    Upto here everything working fine it will displaying 2 check boxes one for News Title with hyperlink and another one News Title without hyperlink in NewsViewDesigner. But the problem is I don't know how to assing News.Title metadata value to Title1 Literal. I did not find any code behind file for ListPageMaster.ascx usercontrol.

    Please help me how to add News.Title metadata value to Title1 Literal

    Thanks,

    Praveen Gundeti
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    10 Jan 2011
    Link to this post
    Hello praveen,

    Generally you should have a metakey with Name - "Title1"

    1. Add a new metakey Title1.
    2. Inside Global.asax you can subscribe for ContentManager.Executed static event where from the arguments you can get the item id.

    sample

    void ContentManager_Executed(object sender, Telerik.ExecutedEventArgs e)
    {
        if (e.CommandName == "UpdateContent" || e.CommandName == "CreateContent")
        {
            var providerName = (e.Data as Telerik.Cms.Engine.Data.CmsContentBase).ProviderName;
            if (providerName == "News")
            {
                var itemID = e.ItemID;
                
            }
        }
    }

    You can call GetContent method of the ContentManager which will return IContent object which will allow you to call GetMetaData and SetMetaData methods.

    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. praveen
    praveen avatar
    11 posts
    Registered:
    02 Aug 2010
    11 Jan 2011
    Link to this post
    Hi Ivan,

    Thanks for your reply. I have created meta key in webconfig file as you specified and I also created ContentManager_Executed method in Global.asax file. But still it is not working and I don't know where I am doing mistake.

    Here I am attaching all screen shots what I have done. Please help me where I am doing mistake.

    Thanks.

    Regards,

    Praveen Gundeti
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    11 Jan 2011
    Link to this post
    Hi praveen,

    Is there any value set for Title1? You can try calling SaveContent method after you set the metakey.

    Regards,
    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
  5. praveen
    praveen avatar
    11 posts
    Registered:
    02 Aug 2010
    11 Jan 2011
    Link to this post
    Hi Ivan,

    I am not setting any value to Title1. I just want to duplicate or same value which holding News.Title to Title1.

    Regards,

    Praveen Gundeti
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    11 Jan 2011
    Link to this post
    Hello praveen,

    You have to duplicate the value to the another metakey, otherwise Title1 control in the list template will not show anything.

    Regards,
    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
  7. praveen
    praveen avatar
    11 posts
    Registered:
    02 Aug 2010
    11 Jan 2011
    Link to this post
    Hi Ivan,

    Sorry to bothering you, I am not understand duplicating value to another metakey. Actuvally I am trying to duplicate Title value to Title1. The Title1 metakey I am not showing in NewsItemNew and NewsItemEdit controls.

    Please give an example or some code for achieving this.

    Thanks,

    Regards

    Praveen Gundeti
Register for webinar
7 posts, 0 answered