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

Forums / Developing with Sitefinity / Author and Source labels in News list

Author and Source labels in News list

7 posts, 0 answered
  1. David
    David avatar
    26 posts
    Registered:
    12 Jul 2008
    02 Apr 2009
    Link to this post
    Hi,

    If I have some news stories that do have an Author and some that do not, how do I hide the label that I have added. For example some stories will display:

    Author: Some Name

    which is fine. But some will display:

    Author:

    which is wrong and I want to hide the label. Any help would be appreciated.

    Thanks
    Dave Cooper
  2. David
    David avatar
    26 posts
    Registered:
    12 Jul 2008
    02 Apr 2009
    Link to this post
    Forgot to mention I am using build 3.6.1861.
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    02 Apr 2009
    Link to this post
    Hi David,

    You can remove the Author label using the approach below:

    You need to open NewsViewControlDesigner in edit mode and under Settings tab, section In the news page, display: find the Author text settings. Click on set Label format and for String format you can set Author: {0}

    For the  every item in the news list, you need to map NewsViewControlDesigner template and alter the following section of it as below:

    <sfDesignSettings:TextSetting ID="TextSetting8" 
                   TargetID="Author"  
                   SettingTitle="Author"  
                   AllowLabelSetting="True"  
                   AllowFormatSetting="True" 
                   AllowVisibilitySetting="True" 
                   TargetVisibleByDefault="True"
     </sfDesignSettings:TextSetting> 

    I suggest that you should upgrade to hotfix 3.6 1870 due to problems with the mapping in the version you are using.

    I hope this helps.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  4. David
    David avatar
    26 posts
    Registered:
    12 Jul 2008
    03 Apr 2009
    Link to this post
    Ivan,

    Thats great. I just have 1 final question, how do I link to my customised version of NewsViewControlDesigner.ascx?

    Thanks
    Dave Cooper
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    03 Apr 2009
    Link to this post
    Hello David,

    This changes should be made in the NewsViewControlDesigner.ascx. After you have modified it, it will be good to remove the control from the page and then add it again. Sometimes the changes does not take effect.

    If your approach is different, let me know.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  6. David
    David avatar
    26 posts
    Registered:
    12 Jul 2008
    03 Apr 2009
    Link to this post
    Ivan,

    I got NewsViewControlDesigner.ascx from the external templates download and customised it as you said in your original reply.

    I know want to know how I can use this new control instead of the built in one. There is no file of the same name to replace so I guess I need to set the path somewhere but I'm not sure where.

    Thanks
    Dave Cooper
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    03 Apr 2009
    Link to this post
    Hi David,

    I got it now.

    You need to map the template . Here are the lines that you should have in Telerik.Sitefinity.ConfigurationControlsconfig.xml

    <viewSettings hostType="Telerik.News.WebControls.Design.NewsViewDesigner" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/NewsViewControlDesigner.ascx" /> 

    layoutTemplatePath is the path. Find attached as an archive the default template of the designer.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Register for webinar
7 posts, 0 answered