I have added a
IShapeTableProvider to try to insert an alternate Content template for my Blog Post detail page. So far I have the below working
public class DataShapeProvider : IShapeTableProvider
private readonly IWorkContextAccessor workContextAccessor;
public DataShapeProvider(IWorkContextAccessor workContextAccessor)
this.workContextAccessor = workContextAccessor;
public void Discover(ShapeTableBuilder builder)
But the problem is that the alternate applies to all Parts_Common_Body shapes so it's not selective enough (my about me page displays the changes for blog posts which is not what I want). On bertrands post about alternates he uses the content item to work
out if the page was the homepage and only then supply an alternate. How do I do the same for Blog Post pages. I tried to access the ContentItem by calling.
ContentItem contentItem = displaying.Shape.ContentItem;
But this returned null.
How do I work out that I am displaying a Blog Posts Detail page?