How can I use alternate shape templates in different zones on the same page? - orchardcms

I'm trying to create a theme in orchard. I have a main content zone and a sidebar zone which is on the right of my main content area (2 column layout). The main content area displays a list of blog posts (including tags, etc. Standard Orchard behaviour).
In the sidebar I would like to display the recent blog post widgets. However, the standard widget renders tags, published date etc. I do not want to display this information in the sidebar zone.
The placement file does not seem to be the right place to configure this as I can't specifically target the Parts_Tags_ShowTags shape in the sidebar zone. Neither does it seem to be possible to create a new template like Tags.ShowTags-Sidebar.cshtml
Any suggestions on how to modify/hide a shape in one zone on a page but not the other?

You can either use an alternate (shape tracing can help with that) or take this over entirely (see this post for details: http://weblogs.asp.net/bleroy/archive/2011/03/27/taking-over-list-rendering-in-orchard.aspx)

Related

Target a specific Widget with Placement.info in Orchard

I use Orchard CMS 1.10.1. In a Page I have lets say four Html widget, I want to place one of these Html Widgets in a local zone.
I used Shape Tracing Tool to get the name of the shape of this specific Html widget But all of these four Widgets have Same the name in Shape Tracing Tool.
So how can I target only one of them?
Firstly, you should add new zone to Theme.txt:
Zones: MyCustomZone, .., .., ..
then after adding your widget to this zone through Orchard dashboard, you can display this zone MyCustomZone, anywhere you want in your system, just using the following line:
#Display(WorkContext.Layout.MyCustomZone)
Note: you don't need to render it in your layout if this is not necessary.
Enable "Widget Alternates" module and alternates with widget name will appear.

HTML Widget on many pages - Orchard CMS

I have an HTML widget in the after-content section which will be displayed on 7 pages out of 12. I was reading up on it but didn't find anything except people mentioning rules, I went through the documentation and looked at using "or" rule with url("~/page1") like url("~/page2") or url("~/page3") so on. Will this not show all widgets on all pages? i just want to show one html widget at the bottom of many pages.
Thanks,
Adil
You should create a new layer "MyNewLayer" and then add your rule(s) there. Then, place the widget to be shown on this layer.

How to create Layout Based on Layer in Orchard

I am trying to create a different layout for a sub-section of my website using Orchard.
Let's say I wanted to give www.site.com/Shop a different layout from the rest of the website; how would I go about doing this?
I have tried looking for a way to do this using layers but have got stuck.
There are several ways to achieve different layout, since I don't know your specific needs I'll throw in some extra possible routes
Use url shape alternate (I guess you need this one)
You have to enable Url Alternates module and it lets you create shape alternates based on url. For example if your page is www.site.com/shop you can then create view under your theme Layout-url-Shop.cshtml and it will be used instead of default Layout.cshtml on your shop.
Orchard documentantion: URL and Widget Alternates
Use 1.x or wait for 1.9
There you can define dynamically different layout per content item aka page. But I find it good only for content not the base layout which is present in layout.cshtml
Create minisite
How to create a minisite inside your Orchard website

Orchard CMS create theme view for my content type

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
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

Placement Position of Content on a Page

I am using Orchard 1.4 and playing around with the Projection Widget.
One thing I am wondering about is how to control the positioning of the content on the Page.
I understand the widgets are placed in the designated zone, but what if I want to put the contents of the projection modules somewhere within the page content?
For Example :
Title
Some Page content here
Projection Module content
Some more Page content here
How do I do that?
Thanks!
You typically use placement.info to change the order of parts on the rendered page.

Resources