Show only latest blog post on homepage

Topics: Customizing Orchard
Aug 23, 2011 at 12:28 AM

I have added a "Recent Blog Post" widget that shows 1 item to the Homepage layout. Now my Homepage content zone looks like:

Zone [Content]

  • Content
  • Widget

I would like to hide the Content shape using the Placement.info using something like:

<Match Path="/OrchardLocal/">
        <Place Content="-"/>       
    </Match>

But this doesn't work. Does anyone have any ideas how I could get this done?

Thanks in advance,

Coordinator
Aug 23, 2011 at 12:37 AM

Can you give more details about what exactly you're trying to achieve?

Aug 23, 2011 at 1:06 AM

Sure. Let me try to explain. I'm trying to hide the entire Content area so that only the Widget is displayed on the home page.

The Content area contains the "Welcome to Orchard!" title, the date, and the "You've successfully setup your Orchard site..." XHTML. I want to hide all of this so that all that is left is the Widget that contains a list of latest blog posts.

Zone [Content]

  • Content (hide this)
  • Widget (latest blog post)

I'm probably not using the correct terminology, but does that make sense?

Thanks,

Coordinator
Aug 23, 2011 at 1:09 AM

Yeah, placement is not going to help. Wouldn't the simplest be to clear the body of that page and publish?

Coordinator
Aug 23, 2011 at 1:11 AM

Alternatively, you could go into layout.cshtml and remove the zone altogether but I'm not sure if you want to do that for all pages or only for the home page. If only the home page, you can install URL alternates from the Designer Tools module and do this in layout-homepage.cshtml in your theme.

Aug 23, 2011 at 1:37 AM

Not exactly because Title is required. Title and Publish Date both appear on the page. If I then hide them with the placement.info that works.

 <Match Path="/OrchardLocal/">
        <Place Parts_RoutableTitle="-"/>      
        <Place Parts_Common_Metadata="-" />
    </Match>
Thanks for you help.

Aug 28, 2011 at 6:46 AM

Just wanted to update this thread. Your idea was much better. Created "Content-url-homepage.cshtml" and then emptied it. Now I have just my Recent Blog Post widget on the home page. Now I have another issue, but I'll create a new thread.

Gracias.