Placement confusion with blog, blog post and custom parts

Topics: Writing modules
Sep 1, 2013 at 7:37 AM
I need some guidance to figure out creating and placement of some shapes.

Here is the story: I have a part that keeps some user data (say MyUserDataPart). Another part that's attached to BlogPost (AdditionalPostDataPart). In the home page, I have a projection of recent blog posts. What I want is:

1- At home page, show user data in the projection for every blog post
2- In the blog page, show the user data only once at top
3- In the blog post page, again show the user data only at once at top

To add the user data to the blog post I did this in AdditionalPostDataPart driver:
        protected override DriverResult Display(AdditionalPostDataPart part, string displayType, dynamic shapeHelper)
        {
            var blogOwner = part.As<BlogPostPart>().BlogPart.As<CommonPart>().Owner.ContentItem;
            return Combined(
                ContentShape("Parts_AdditionalPostData", () =>       
                    shapeHelper.Parts_AdditionalPostData (
                    // stuff here
                    )),
                ContentShape("Parts_MyUserData", () => 
                    _services.ContentManager.BuildDisplay(blogOwner.As<MyUserDataPart>(), displayType))
           );
        }
Using BuildDisplay this way doesn't feel right but user data shape is rendered in the projection at home page. I can't figure out how to hide it in blog and blog post pages though. Also, I couldn't find a way to show it once at the top in these pages.

Any suggestions?
Sep 2, 2013 at 4:31 AM
I gave up trying to do this with combined result and overridden Title part for Blog and BlogPost, getting to MyUserDataPart though ContentItem.CommonPart.Owner. I can't get some data I fetch using some services in the MyUserDataPart driver, but fine for now.