1
votes

I have a simple Content Type, let's say BlogPost. I want a widget "Recent blog posts". I know it exists as out of the box widget for Blog Posts. But we are imagining a generic Content Type here in place of Blog Post. I want to create it as a Projection Widget.

I made a Query, created projection widget, named it "Latest Blog Posts", and it works fine. Now I would like to specify exact template that each of the blog posts in that projection list should use when displaying.

Currently, here are my options for shape alternates in this situation: enter image description here

So, in the left pane: Widget is a Projection Widget I created. It uses a Query on Blog Post content types with grid layout. Each of the "Content" items in the left pane represent one of the Blog Post that the projection is showing.

Now, for example, I would like each of the Blog Posts to be shown in a short variant. I don't want to override BlogPost.Summary shape template since I may need that shape somewhere else on the site.

In the right pane I have all of the available alternates for a single Blog Post shape inside a projection widget.

Ideally, I would like to have an alternate shape template called something like: "~/Themes/Bootstrap/Views/Content-BlogPost.Summary.LatestBlogPosts.cshtml"

After that I would go for: "~/Themes/Bootstrap/Views/Content-BlogPost.Summary.ProjectionWidget.cshtml"

Or anything of that kind in order to have special shape template for showing a blog post inside a projection widget.

My alternative approach was using the Placement.info file. I wanted to hide certain parts of a BlogPost:

<Match ContentType="ProjectionWidget">
    <Place ShapeParts_Common_Metadata_Summary="-" />
    <Place Parts_Tags_ShowTags="-" />
    <Place Parts_Common_Body_Summary="-" />
</Match>

This segment does nothing. I haven't been able to make it work yet.

So, I hope I made my problem clear. I want to be able to specify the exact look of a Blog Post when it is showing in a Projection Widget. How can I do this?

1

1 Answers

0
votes

It's way easier to change the display type.