Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Orchard CMS create theme view for my content type

Tags:

orchardcms

I am using orchard cms with the bootstrap theme.

I have created a content type: House

it contains FIELDS

  • image (media picker field)
  • Property Type (taxonomy field)
  • Location (taxonomy field)

It has PARTS

  • common
  • body
  • publish later
  • Title
  • Autoroute

I want queries of houses and be able to choose the view/ layout for them

e.g. layout called HouseList (for sidebars mainly) which will render: title, image and link to house, possible location and type but with out the links as defaulted. And then a fullDetails layout and a image only layout (so i can show a jquery image reel a widget say in a quadzone) How can i do all this please, i have tried in view Content-House.cshtml etc but i cant access the details model.content to choose what to display.

Im sure when i get the idea of how to do 1 i should be able to sort the rest. I have read documentation etc but there are so many different ways, ie placement file, change the parts, contents, create classes to handle display etc. sureley i am missing something simple like create a view for each list i want eg. houue-list, house-details, house-imageONly and then manipulate content.

Please help i have been trying different things for getting this site running for weeks and not getting very far. Examples would be fantastic but i have searched google for hours and found similar but nothing with enough details for a meer beginer.

Thanks

like image 444
Jonnymaboy Avatar asked Nov 04 '22 10:11

Jonnymaboy


1 Answers

The standard way of doing that is placement to move things around and alternate templates for the different parts and fields. You can specialize placement and alternates with the display type, which is Summary when rendering in a list such as what a projection returns, and Detail for the detail view. More info on placement can be found here: http://docs.orchardproject.net/Documentation/Understanding-placement-info and on alternates here: http://docs.orchardproject.net/Documentation/Alternates

Now if you prefer to completely take over the rendering and do without placement, here are a few posts that may help:

http://weblogs.asp.net/bleroy/archive/2011/07/31/so-you-don-t-want-to-use-placement-info.aspx

http://weblogs.asp.net/bleroy/archive/2011/03/27/taking-over-list-rendering-in-orchard.aspx

like image 89
Bertrand Le Roy Avatar answered Dec 19 '22 18:12

Bertrand Le Roy