Urls and Classifications

Posted by Community Admin on 04-Aug-2018 14:16

Urls and Classifications

All Replies

Posted by Community Admin on 05-Sep-2015 00:00

I have created two simple classifications, can I create a url that will filter on both classifications?  Or do I have to make a hierarchical classification in order to get this behaviour?

Thanks

Posted by Community Admin on 09-Sep-2015 00:00

Hello,

You cannot filter by multiple classifications in the URL. You can however, achieve this using our API.

You can find below a sample that filters News items based on 2 custom classifications (Custom tags and Geographic regions):

using System;
using System.Linq;
using Telerik.OpenAccess;
using Telerik.Sitefinity.GenericContent.Model;
using Telerik.Sitefinity.Model;
using Telerik.Sitefinity.Modules.News;
 
...
 
var newsManager = NewsManager.GetManager();
 
Guid customTagId = Guid.Parse("bb474327-016d-6bce-b4b3-ff0000fe52e7");
Guid geographicRegionId = Guid.Parse("d34c4327-016d-6bce-b4b3-ff0000fe52e7");
 
var newsItems = newsManager.GetNewsItems()
    .Where(n =>
            n.Visible
            && n.Status == ContentLifecycleStatus.Live
            && n.GetValue<TrackedList<Guid>>("customtags").Contains(customTagId)
            && n.GetValue<TrackedList<Guid>>("geographicregions").Contains(geographicRegionId)
        );


Regards,
Velizar Bishurov
Telerik
 
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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 09-Sep-2015 00:00

Thanks Velizar,

 

It's not quite a nice from an SEO perspective.  Where /property-to-rent/London/2-bed would work better.  But I guess the only way to achieve this would be to have a hierarchical classifications.  Where for each place, you would have a sub-category of 1-beds, 2-beds, etc.?

This thread is closed