OrchardCMS Shape tracing not showing up for custom theme - orchardcms

I'm creating a custom theme for my new Orchard site. The shape tracing module is incredibly useful, but for some reason it isn't rendering in my custom theme. I'm not sure what I might be missing to get it to appear.
When I set my site to use the theme TheThemeMachine, it appears just fine at the bottom of the page. When I compare the rendered source from the TheThemeMaching and my custom theme, I see all the CSS & JS references in the head for the shape tracing module. However when I scroll to the bottom of the source of my custom theme, I don't see all the script blogs with the JSON objects. I just see a lot of empty script "shape-tracing-wrapper" blocks.
Ideas?

You're missing a zone named Tail in your document.cshtml. Compare your theme's version with the one in Core/Shapes/Views.

Related

Mixing content and widgets

I am new to Orchard and question myself how to mix up widgets and content. As of my understanding, the page content type has one layout where you put all your content in: HTML, images, et cetera. Where it will get displayed is defined by the theme. By placing widgets into the zones of the theme I can display custom modules in addition.
But, what if I want (for one specific page, from top to bottom)
Content/HTML -> Widget -> More Content/HTML -> Another Widget -> Even more Content/HTML?
I know it is possible to achieve that by placing the second and third content block into a widget and configure the layer to match the url of my page, but this seems to me like a hack.
In DNN you can place everything, HTML as well as modules, into the exact container/zone you want. In nasty Joomla! you can "import" modules (widgets) as part of the HTML of an article.
What is the way to achieve that mix up in Orchard?
You have tagged the question as orchardcms-1.10 so you should be able to do it.
Orchard has a module called Orchard.Layouts which provides the functionality that you are describing.
Are you using an upgrade old version?
If you have upgraded your site from an older version of Orchard then it will still just have the old style BodyPart as its main content editor. Fresh installs will have LayoutPart which can provide these kinds of complex layouts.
For an introduction on this subject look at IDeliverable's Orchard Layouts intro article.
If you are working with an old upgraded version please add a comment and I will explain the upgrade process.
Have you enabled the Layout Widgets module / feature?
If you already see this but can't add the widgets then make sure you enable the Widget Elements feature:
Go to:
Admin panel
Modules
Type widget into the filter at the top
Click Enable on the Widget Elements feature
Now when you go back to the layout editor you will see a new category with all the widgets placeable as elements.

How to style the 'blog' in orchard CMS

How can I style the 'Blog' for which I added via Orchard CMS dashboard.
For some reason, this section: Once added, adds fine, but is just black & white with 0 styles included from the rest of the site. I'm trying to figure out how to style this with the rest of the site.
With the /Styles/
Folder I have tried:
/menu.blog-admin.css
/orchard-blogs-admin.css
/orchard-blogs-archives.css
But none of these styles I've added to any of these files rendered. Any advice?
The best place to start will be in Orchard Docs
You will need to add your styles, script and other content as Orchard Resources, by implementing IResourceManifestProvider and adding your styles. Then in, your blog views you can use Style.Require('YourStyle').
Here's how in this page of Orchard Docs
Use Shape Tracing to identify files which you may wish to override
Read about Alternates
To quickly just add a style try this answer

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 - injecting css classes into navigation / editing navigation HTML

I have a site laid out in HTML/CSS - based on Twitter Bootstrap.
I have created a new template in a new orchard instance.
I have a navigation that requires some classes from bootstrap applied to the .
The Orchard Layout uses this for navigation:
#Display(Model.Navigation)
How can I edit the HTML it outputs - and / or add some classes to the ul that's rendered in the navigation by Orchard?
Thanks.
That line in Layout.cshtml is showing the navigation zone, which is one of the widget zones.
In a standard Orchard setup a Menu Widget gets placed in that zone. You can check on the Widgets page in the admin. This doesn't directly show the menu widget though. This is done by another template.
In most cases the easiest way to find out which templates are being used is to use the Shape Tracing tool, which is part of the Orchard Designer Tools. There's an intro to Shape Tracing in the Orchard Documentation.
There are several layers of menu templates and it is a bit tricky to find these in the shape tracing tool.
The templates relevant to menus that you may need to include in your theme are:
MenuItemLink.cshtml
MenuItemLink-ContentMenuItem.cshtml
MenuItem.cshtml
If you can't find them in the shape tracing tool, then do a file search in your solution and copy these files to your theme.
One option could be to use Vandelay.Classy module and add classes to your content item http://orchardproject.net/gallery/List/Modules/Orchard.Module.Vandelay.Industries
Other could be to create a alternate template for Navigation Shape. you can designer tools to create alternate.
http://orchardproject.net/gallery/List/Modules/Orchard.Module.Vandelay.Industries

A bit confused with creating custom content parts and placement

I'm trying to create a Custom Part that just drops text into the page. I've created a part using the GUI that I called "Side Feature" and I added a text field called "Featured". I am trying put it on the side bar which I created on my layout, but I don't know how to move it to the sidebar. It shows up on my main content.
How do I move it to the sidebar? I tried using "#Display(Model.Featured)", but that doesn't seem to work. I also read about the placement.info file, but I'm not too sure how that would work in this sense.
I couldn't find a tutorial/blog post online similar to this. Most of them were too advanced. I am very new to Orchard.
You can't without code or additional module: sidebar is a zone for widgets, not for content parts. Placement info only works for local zones within the global Content zone.
If you want to do it through code, follow this: http://weblogs.asp.net/bleroy/archive/2011/03/26/dispatching-orchard-shapes-to-arbitrary-zones.aspx
If you want to use a module, look for Origami on the gallery.

Resources