Created
December 14, 2015 14:17
-
-
Save carlwoodhouse/a6addfb7baab8c8c7819 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Linq; | |
| using Orchard; | |
| using Orchard.DisplayManagement.Descriptors; | |
| using Orchard.Environment.Extensions; | |
| [OrchardFeature("The.Name.of.a.Feature")] | |
| namespace YourProvider.Providers { | |
| public class YourPrivider : IShapeTableProvider { | |
| public void Discover(ShapeTableBuilder builder) { | |
| builder.Describe("Content").OnDisplaying( | |
| displaying => { | |
| if (somecondition, path or shapename or something) { | |
| displaying.ShapeMetadata.Alternates.Add("HereBeAShape"); | |
| } | |
| } | |
| }); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment