This project is read-only.

Getting to the right bit of the Template

Jan 20, 2011 at 1:10 AM

In my theme I'm overriding Content.Summary.cshtml to change how summaries are layed out.

This displays the following zones (not sure if they're still called zones in this context, they might be shapes):

  • Header
  • Content
  • Meta
  • Footer

I want to move where the date, comments link and tags are displayed in relation to each other, but these aren't in this template. Where can I find them? Is there a seperate template for each zone/shape in the template I'm looking at?


Richard Garside.

Jan 20, 2011 at 1:29 AM

The date is rendered by Parts.Common.Metadata.Summary.cshtml, comments by Parts.Comments.Count.cshtml and tags by Parts/Tags.ShowTags.cshtml. Where they appear is determined by their respective files.

Jan 20, 2011 at 11:23 PM

I've added a file to the route of my theme and all works fine.

In case others are trying to do the same it looks like this:

	<Match DisplayType="Detail">
		<Place Parts_Tags_ShowTags="Footer:1"/>
	<Match DisplayType="Summary">
		<Place Parts_Tags_ShowTags="Footer:4"/>
		<Place Parts_Comments_Count="Footer:5" />

This changes were tags and the comment count elements are displayed.

Feb 14, 2011 at 2:21 AM

This is cool but I wanted to structure my footer on one line. I tried the following in my Content.Summary.cshtml:

     <div class="metadata">
            @Display(Model.Meta) @Display(Model.CommentCount) @Display(Model.ShowTags)

But the Model.ShowTags part doesn't work. Any suggestions?

Feb 14, 2011 at 11:45 PM

Those Display calls really are creating local zones. If nothing inserts contents into those zones nothing will happen. Hence your placement file should contain something like this:

<Place Parts_Tags_ShowTags="ShowTags:1"/>

I think.

Feb 15, 2011 at 12:21 AM

I gave it a try, but it didn't seem to change anything. I'm actually trying not to use the I'm trying to do handle all of the display through the views.

Which causes the parts/Tags.ShowTags.cshtml to be rendered above the content (I guess the default placement). The metadata and comment count render correctly when placed in the Content.Summary.cshtml as described above. Shouldn't I be able to show the tags from the model as follows. 


Thanks in advance,


Feb 15, 2011 at 12:34 AM

> I'm actually trying not to use the I'm trying to do handle all of the display through the views.


Well, anyway, Model.ShowTags is not going to do the trick because it does not exist (so it dynamically creates an empty shape, which is the same thing as a local zone). You need to display the actual tags, which you can probably access through Model.ContentItem.As<TagsPart>().CurrentTags