Layer Rule limitations

Topics: General
Oct 25, 2012 at 7:48 PM

I tried using a "*" in the middle of a path but it doesn't seem to work... (ie: url("~/*/features*").

Is there any workaround you can think of?

The use case: 

I'm using the following autoroute pattern:

{Content.Fields.FeatureCollection.RelatedProduct.Content.Slug}/features/{Content.Slug} in order to come up with a generic approach for displaying the features of a specific product.

{Content.Fields.FeatureCollection.RelatedProduct.Content.Slug} will be replaced by the product name.

I want a specific layer for "feature" pages whatever the product.

Oct 26, 2012 at 12:42 AM

Yes, the star is only at the end of the path as far as I can remember. Workaround is to implement you own rule provider. You can look at the url rule as a starting point.

Oct 26, 2012 at 1:00 AM

True, it's only in the end, take a look at:
Orchard.Widgets > RuleEngine > UrlRuleProvider.cs

You would have to write a rule, that does something like splitting the url at location of the '*' and then match the route-parts piece for piece.

Oct 26, 2012 at 7:23 AM

At this time, I'm just evaluating Orchard so that I'm not sure I'll go into writing my own rule provider but that's good to know.