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
Related
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 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
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
I have a custom theme, the footer, header & home page are all working.
I have a main navigation that links to 5 pages.
I now need to set the style for these 5 pages - and the other pages that link from them (it's different to the home page) - one section of which needs an additional navigation menu on the left (main nav is top).
Would I do this in Visual Studio - or can it be done through the admin web interface?
What is the best approach?
Thanks.
You can add an additional navigation widget on a layer that is not the homepage. As for styling differently on different pages, you could do that many ways.
For example, you could check if the page you are loading is the homepage and load some styles to overwrite the default ones. That would be the easy way I suppose.
If you need a whole new layout for the homepage, you could check out this module on the gallery which lets you select a different layout to use for each content item. Never used it myself, but looks like it could be cool :) http://gallery.orchardproject.net/List/Modules/Orchard.Module.Downplay.Orchard.LayoutSelector
I'm using Orchard 1.6 and I'm trying to get my breadcrumb widget working for all pages and taxonomies.
For the pages, when a page is selected, the breadcrumbs work as expected:
Home > My Page > My Sub Page
However, as part of this menu (the main menu, as set up by the 'Default' Orchard recipe), I have added some Taxonomy terms (by adding the 'Menu' part to my taxonomy term content type).
When I view the term page (front end), the breadcrumbs don't render as breadcrumbs, but the full menu instead.
What I would like to know is: How do I make the breadcrumbs recognise the taxonomies and render correctly?
Is there a part I need to add to a specific content type?
For now I need to use the dirty, dirty work-around of using a HTML widget; naturally I would prefer an actual solution.
Thanks in advance!