This project is read-only.

Creating custom pattern in custom content type items

Topics: Writing modules
Mar 6, 2014 at 8:50 AM
I have, say 20000 custom content items in my application. Now I want to create layer rules to associate groups of those items(say 1500 at a time based on some criteria) at run time. I tried to create layer rules like url("~/item1") or url("~/item2")..... so on till 1500 items, but due to extensive string length it crashes most often.

How can I achieve this functionality without changing the permalinks of my custom content items.
Any help will be highly appreciated.
Mar 6, 2014 at 10:20 AM
You can, I guess, use AliasUI module to create duplicate url's for the content items to group them in virtual folders. You would need to have some permanent redirect mechanism, either IIS URL rewrite or Orchard RewriteRules module.

If this doesn't agree with "no change to permalinks" condition, you can develop a custom module with a rule provider. Check Orchard.Widgets\RuleEngine\ContentDisplayedRuleProvider.cs and Orchard.Widgets\Handlers\DisplayedContentItemHandler.cs for an example.