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

Forums / Designing with Sitefinity / Customising NewsList(NewsView) Control

Customising NewsList(NewsView) Control

8 posts, 0 answered
  1. Johan Lausbcher
    Johan Lausbcher avatar
    10 posts
    Registered:
    08 Jul 2009
    28 Jul 2009
    Link to this post
    HI There guys

    I'm trying to fidn a way to modify the existing NewsView control that is being used on one of our CLients website.

    I have read / search and tried to implement some of the techniques described on the blogs / forums but still i'm not getting any success.

    Currently we have just a simple NewsView Control that is dropped on the Homepage, and then thatofcourse displays the News Article items that is defined under the News Module.

    I wanting to find a way to just change the layout structure for the News Items that are being displayed , for ex. currently they are displaying below each other as list , but i need them to appear horizontally instead of vertically

    The project was orginally designed in Sitefinity 3.2 and we did manage to modify (i would say rather "Hack") the way the news items appear the way we want to, but since i'm currently rebuilding the site from scratch in SF 3.6 and i know its possible to apply a custom control template to an existing control like the NewsView control, in order to define your own layout if you want to., i rather want to do it the right way.

    I first hoped that i could just copy the old existing NewsList control together with its .resx and the CSS file it uses
    into the new 3.6 project but I cant seem to find any NewsList control under the SF 3.6 control templates. I think there were certain structure changes with the new 3.6 version

    I then tried the '' option , by trying to map the NewsView control within Sitefinity to the existing NewsList Control(and all its related files) that i've copied into the new 3.6 websites' project folder: "Sitefinity/Admin/ControlTemplates/News/ "
    but then gives me different errors inside of Sitefinity.

    Because i'm not really dedicated programmer/developer , so I was hoping you guys could help me in simple step by step basis (if possible) on how i could get thelayout change on the NewsView control.

    If i need to edit and customise the layout in Visual Studio and then just find a simple enough way to apply the new layout on the existing NewsView control , that would be great
    or alternatively if there would be a way to use the exsiting NewsList control with the existing CSS style sheet and just place it in the correct place so that Sitefinity will be able to pick it up , so that it will display as it did in the 3.2 version of the Website.

    Any help would be greatly appreciated

    Thank

    Johan Laubscher
    BlueAnt Productions




  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    28 Jul 2009
    Link to this post
    Hi Johan Lausbcher,


    I first hoped that i could just copy the old existing NewsList control together with its .resx and the CSS file it uses into the new 3.6 project but I cant seem to find any NewsList control under the SF 3.6 control templates. I think there were certain structure changes with the new 3.6 version


    NewsList control is obsolete and no more in use. Please use NewsView control instead.

    Since version 3.6 we introduced embedded templates. Please take a look at the following article that describes how to map an external template for ContentView based control - Working with presentation modes.

    Once you map the external template you can style it. There are two options here - add you classes in the theme used for styling your page or use CssFileLink control in presentation mode templates(ListPageMaster and ListPageDetails).

    <telerik:CssFileLink ID="CssFileLink1" FileName="~/test/eventsCommonLayout.css" FileName="" Media="screen" runat="server" /> 


    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Johan Lausbcher
    Johan Lausbcher avatar
    10 posts
    Registered:
    08 Jul 2009
    31 Jul 2009
    Link to this post
    Hi Ivan

    sorry for only responding to you only now , was caught up with other things regarding the website developemnt

    "NewsList control is obsolete and no more in use. Please use NewsView control instead."

    Can you maybe just clarify something for regading your statement ... When you say NewsList control is obsolete, does that not effect the NewsVIew control also?
    I actually am using the NewsVIew control in my page , they way i understood it , is that the NewsView Control makes use of the NewsList control to display the News items as defined in the News Module  section.
    Or am i missing something?
    "Please use NewsView control instead."
    So could you clarify what you mean by that? because i am using the NewsView control ..

    johan
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    31 Jul 2009
    Link to this post
    Hello Johan Lausbcher,

    The response was with regards to

    "I first hoped that i could just copy the old existing NewsList control together with its .resx and the CSS file it uses
    into the new 3.6 project but I cant seem to find any NewsList control under the SF 3.6 control templates. I think there were certain structure changes with the new 3.6 version"


    As I see in the previous post I described how to manage NewsView control as well(working with presentation modes article).

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Johan Lausbcher
    Johan Lausbcher avatar
    10 posts
    Registered:
    08 Jul 2009
    03 Aug 2009
    Link to this post
    Hi Ivan

    Thanks for Clarifying.

    But regarding the actual applying a custom template I'm unfortunately still unsuccesful.

    AT the point when i create the Configuration folder with Telerik.Sitefinity.Configuration.ControlsConfig.xml file inside the App_Data folder, and the Telerik.Sitefinity.Configuration.ControlsConfig.xml file changed to look as follows:

    <?xml version="1.0" encoding="utf-8"?>  
    <controlsConfig>  
       <viewMap>  
            <viewSettings hostType="Telerik.News.WebControls.Admin.NewsItemsList" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/NewsItemsList.ascx" />   
       </viewMap>  
    </controlsConfig>  

    I then keep on getting a 'Runtime error' in viewing the Website and in editing mode inside Sitefinity

    Can you tell me what i could be possibly doing wrong? or what causes this?

    any help appreciated

    thx

    Johan
    BlueAnt



     
  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    03 Aug 2009
    Link to this post
    Hi Johan Lausbcher,

    Can you be more specific on the run time error you are getting, so that we will be able to help you solve it? And one more thing, can you make sure that the template file actually exist in your project (you might need to download the External Templates archive from your Client.Net account).

    All the best,
    Rado
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  7. Johan Lausbcher
    Johan Lausbcher avatar
    10 posts
    Registered:
    08 Jul 2009
    03 Aug 2009
    Link to this post
    HI Rado
    It seems strengley enough the Runtime problem somehow was unrelated .. because i cant seem to simulate it again,. so that put aside

    But yes I have checked that the template file exists in website project which is NewsItemsList.ascx as well its .resx file,

    This is the procedure i'm following:

    1. Created Configuration folder under App_data with Telerik.Sitefinity.Configuration.ControlsConfig.xml inside (code is as shown before )
    2. Then I restart IIS
    3. Then i insert the following : <telerik:CssFileLink ID="CssFileLink1" FileName="~/Sitefinity/Admin/ControlTemplates/News/newsCommonLayout.css" Media="screen" runat="server" /> inside NewsItemsList.ascx in order to link my own stylesheet to the Template control.

    But there still no change as to how the news items appear on the webpage

    Maybe there something i'm missing, or doing wrong ... because i'm relatively new with using Sitefinity and especially customising within Sitefinity

    Thanks for your help (and patience :)

    johan




  8. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    03 Aug 2009
    Link to this post
    Hello Johan Lausbcher,

    Thank you for getting back to us.

    Just one more question. Are you trying to change the styles for the back-end (Sitefinity administration), or for the front-end (public view of the news)? I want to clarify that because what I can see from your code is that you are mapping the template for the Telerik.News.WebControls.Admin.NewsItemsList which is the control that displays news items when you are in the News Module in the administration side of your website. The views responsible for the public end are in ~/Sitefinity/ControlTemplates/News, not in ~/Sitefinity/Admin/ControlTemplates/News (these here are for the backend).

    Having this said you should modify the ~/Sitefinity/ControlTemplates/News/ListPageMaster.ascx to make the public view of the news display your styles. After you have edited the template, you should map it like this:
    <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.--> 
            <!--Remove this if you do not want your single item news view to use an external template.--> 
            <add key="SingleItemTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/News/ListPageDetails.ascx" /> 
          </additionalTemplates> 
        </viewSettings> 

    Sincerely yours,
    Rado
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
Register for webinar
8 posts, 0 answered