Most of you are probably aware that since Sitefinity 3.6 we have moved to using embedded control templates for Sitefinity's controls. This means that if you wish for example to modify the look and feel for the New View control you will have to map its external template and edit it to achieve the desired result. In the following article we will give you some guidance on how to change the style rules for content view controls. We will work with the News View control as an example.
Before you start I will suggest that you look at the following resources if you have any doubts on how to work with Sitefinity's control templates:
Introduction to ControlsConfig file
How to map a view to an external template, in Sitefinity 3.6 or later?
Once you have gained better understanding on how to map controls to use external templates you will need to make the News View control use the external templates. The files you will need to modify are ~/Sitefinity/ControlTemplates/News/ListPageMaster.ascx and ~/Sitefinity/ControlTemplates/News/ListPageDetails.ascx. What you should do with those files is to change the CssFile link to point to your custom css files:
| <telerik:CssFileLink ID="CssFileLink1" FileName="~/Path to your style sheet" Media="screen" runat="server" /> |
Then you should map the control to the templates using the following view settings in the ControlsConfig file and restart the website:
| <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> |
For your convenience I am sending you as an attached file the default CSS styles for the content view public controls. This will save you some time from building the styles from scratch.