Buttons on List Items

Topics: Customizing Orchard
Mar 4, 2012 at 2:32 PM

I'm trying to figure out how to go about adding buttons to List Items

 

I'm new to Orchard and MVC.

Developer
Mar 4, 2012 at 2:53 PM
Edited Mar 4, 2012 at 2:55 PM

You could do so by overriding the template in your theme.

For example, if your list is rendering a list of BlogPost content items, each item is rendered in the form of a Parts_BlogPost shape. Now, each shape is rendered via a Razor template. Which template gets selected depends on a variety of things, one of which being the display mode.

When a List is rendered, the Display mode is "Summary". You can use this display mode to create an alternate shape template in your theme. In this example, you could create a razor file called "Parts.BlogPost.Summary.cshtml". Inside that template, you can add a button.

If you're abolsutely new, you should probably start with this tutorial, which may take you up to speed. It also demonstrates how to add a "Add to Shoppingcart" button to List Items, so this may serve you well.