This project is read-only.

Using Alternates in multiple environments

Topics: Writing themes
Nov 14, 2012 at 3:05 AM

Hi all,

We would like to have 2 variations of FeaturedItem sliders on a homepage so we created an alternate - Parts.FeaturedItems-121.cshtml - where 121 is the id. However we are wondering how to do this without having a potential mismatch between test & production environments where the ids might not necessarily be the same.

Is there a better way to differentiate between 2 content items that are the same type?

Nov 14, 2012 at 3:25 PM

You could add more alternates to the shape, for example using a property of FeaturedItem slider that is static across environments. Is there a name property, or an Identifier? 

You can implement an IShapeTableProvider interface to hook into the creation of the FeaturedItem slider shape and add the layout. I think Bertrand has a blog post describing how to do this.