How to add custom fields or classification to filter in "which news to display>>Selection of News"?
We have list of locations and have to filter news of a particular location news only.
Please find the attached image for more information.
Posted by Community Admin on 09-Oct-2013 00:00
In order to add custom fields and classification to filter you need to follow this steps on the backend:
(The example is for 'Locations' filter in the News module)
1. Under: Content > All classifications > Create a new classification
- Classification: Locations
- Single item name: Location
- Type: Simple list
Click [Create Classification]
2. Under Content > News > (on the right panel) Custom Fields for news
- click [Add field] button
- Type: Classification, and choose newly created classification (Locations)
- Name: Locations
Click [Save changes]
3. Under Content > News, create some news and fill in a location field
(Registering of the new filter)
4. Take the TaxonomyId of the newly created filter
- under Pages > Create a page, create new page (or use an existing one) and add Tag widget (under Classifications module)
- Click  of this widget and leave empty the 'TaxonomyId' field and click [Save]
- Get the id under desired classification (in our case 'Locations'), something like 'd147abea-018b-6a03-94cc-ff0000651fc8'
5. In the attached file 'ContentSelectorsDesignerView.ascx' I have added for you a new section /<designers:FilterSelectorItem ID="FilterSelectorItem4".../ which will register this new filter.
- replace the id from step 4 in that section
- include this file in your project. (Note that it is set for the root project directory). In case you need to change the name of the filter (in our case Locations or the path to the .ascx file) you need to change the respective settings in the above mentioned section.
6. Remove Tag widget from step 4, it is no more needed
7. Then go to Sitefinity backend -> Administration -> Settings -> Advanced -> Controls -> ViewMap and create a new one with the following properties:
LayoutTemplatePath: ~/ContentSelectorsDesignerView.ascx (the path to the template in my case it was in the root)
8. Add News widget on your page and now you could filter by this newly create one.
I hope the information was helpful. Please fill free to write back if you need additional information.
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items