Display ContenBlock by category
Hi
Can anyone help me, on how to display content blocks by category, using the Categories Widget. It's possible width images, docs. blogs and so on, but wath about content blocks??
Is there another aproach ?? :-)
Best regards
Christian
Hello,
The categories widget is not working with Content Blocks. For performance reasons we have tried minimizing the amount of data being pulled in our ContentSelectors throughout Sitefintiy. Loading all the avaialble tags and categories and filtering by them woul impose slower loading of the data in general.
If you want you could pull all content blocks filtered by specific tag/category in a custom widget programatically. For example:
var manager = ContentManager.GetManager();
var myBlocks = manager.GetContent().Where(contBlock => contBlock.Status == ContentLifecycleStatus.Live && contBlock.GetValue<
TrackedList
<Guid>>("Tags").Contains(singleGuid));
singleGuid
is the ID of your tag to filter by. To use the above sample you'll need to add a using Telerik.Sitefinity.Model in your class, to be able to use the extension method GetValue<T>().Hello Stefani
Thank's for your reply.
In the meantime i have tried to create a module and by the categories widget sorte by dynamic content type. That approach almost work - but how do i get the widget to display content, not only in top level categories??
Hope there is a solution for that :-)
Second question - regarding Responsive Design :
On the default group of rules i have applyed a css file to modify the layout. But the css file overwrite the default css file and apply the mobile css styles on all devices.. Could you help on that matter to ???
Look forward to your reply :-)
Best regards Christian