Changing the Display Order of rows on the Blog Detail page

Topics: Customizing Orchard
Aug 2, 2011 at 3:23 AM

On my blog detail page in Orchard I have the blog post itself rendering on the page first, then the comments list, then the new comment form, and then the tags the post is tagged with. How do I change the display order of these rows for the blog post detail page? I'd like to have the tags for the blog post before the comments but I'm not sure where this is managed.

Thanks for listening,

b

Coordinator
Aug 2, 2011 at 4:54 AM

You need to look into placement.info: http://orchardproject.net/docs/Understanding-placement-info.ashx

Aug 2, 2011 at 3:30 PM
Edited Aug 2, 2011 at 3:31 PM

I've read that piece of documentation and checked the placement.info file of the blog module and my theme but it was still not clear to be how I could move the tags row of the blog detail page to be before the comments rows. The placement.info file at the root of the Orchard.Blogs module looks like:

<Placement>
    <!-- available display shapes -->
    <!--
        Parts_Blogs_Blog_Manage
        Parts_Blogs_Blog_Description
        Parts_Blogs_Blog_BlogPostCount
        Parts_Blogs_BlogPost_List -> when in the blog detail display the blog post list is currently hard-coded to Content:5 to enable the current state of blog paging
        Parts_Blogs_BlogPost_List_Admin
    -->
    <!-- widget and edit shapes just get default placement -->
    <!-- edit "shapes" -->
    <Place Parts_Blogs_Blog_Fields="Content:2"/>
    <Place Parts_Blogs_BlogArchives_Edit="Content:5"/>
    <Place Parts_Blogs_RecentBlogPosts_Edit="Content:5"/>
    <!-- widgets -->
    <Place Parts_Blogs_BlogArchives="Content"/>
    <Place Parts_Blogs_RecentBlogPosts="Content"/>
    <!-- default positioning -->
    <Match ContentType="Blog">
        <Match DisplayType="Detail">
            <!-- blog posts currently added to the blog within the controller into Content:5 <Place Parts_Blogs_BlogPost_List="Content:5" /> but...
                 ...placing it in in the Content zone as it's currently implemented to light up the RSS feed for the blog... -->
            <!-- Parts_Blogs_RemotePublishing is made available with the "Remote Blog Publishing" feature -->
            <Place Parts_Blogs_BlogPost_List="Content"
                   Parts_Blogs_Blog_Description="Content:before"
                   Parts_Blogs_RemotePublishing="Content"/>
        </Match>
        <Match DisplayType="DetailAdmin">
            <Place Parts_Blogs_BlogPost_List_Admin="Content:5"
                   Parts_Blogs_Blog_Manage="Actions"
                   Parts_Blogs_Blog_Description="Actions:after"/>
        </Match>
        <Match DisplayType="Summary">
            <Place Parts_Blogs_Blog_Description="Content:before"
                   Parts_Blogs_Blog_BlogPostCount="Meta:3"/>
        </Match>
        <Match DisplayType="SummaryAdmin">
          <Place Parts_Blogs_Blog_SummaryAdmin="Actions:10"/>
          <Place Parts_Blogs_Blog_Description="Content:before"/>
        </Match>
    </Match>
</Placement>

 

And my theme's placement.info file looks like:

<Placement>
  <!-- Customize where the shapes are rendered -->
 
  <Match Path="/">
    <Place Parts_Tags_ShowTags="Content:before"
           Parts_Common_Metadata_Summary="-"
           Parts_Comments_Count="-"
           />
  </Match>
 
  <Match ContentType="BlogPost" Path="/blog/*">
    <Place
      Parts_Common_Metadata_Summary="Header:before;Alternate=Content-url-blog.Summary"
      Parts_Tags_ShowTags="Content:After"
      Parts_Comments_Count="Content:After"/>
  </Match>
 
 
  <Match Path="/About">
    <Place Parts_Common_Metadata="-"/>
  </Match>
 
</Placement>

 

I see views in the comments module called ListOfComments.cshtml and Parts.Comments.cshtml but when I add attributes to the Place node under <Match ContentType="BlogPost"> it doesn't seem to move those rows around.

b

Coordinator
Aug 2, 2011 at 9:01 PM

Try using explicit numbers or dotted number sequences rather than before and after.