Orchard CMS - Custom Theme, Creating sections, one with second Navigation - orchardcms

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

Related

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.

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

Custom information pages not using SEO friendly URLs in OpenCart

I am having issues with the opencart layout override feature. I have created a new information page and I set the layout override to "test". The route for this layout is "information/test". The controller is in the right place, as is the template. I gave the new page the seo-friendly url of "test-page".
My issue is that if I type in "domain.com/test-page" it will get there, but it uses the regular information layout instead of my customized test layout. I can type in domain.com/index.php?route=information/test&information_id=119 and it will now show the page with the right layout.
Is there a way to have it go the customized layout page (domain.com/index.php?route=information/test&information_id=119) when I type in the seo-frindly URL that I created when I created the new information page.
My issue is I am trying to add a carousel to just one information page, while still using seo-friendly URLs.
actually what you coded in template file test.tpl is not a layout, its actually a page accessed using test.php controller , and that page can be opened by accessing url domain.com/index.php?route=information/test&information_id=119 as you already mentioned.
How to create layout then ?
You have already created layout named test by going to System >> Design >> Layouts, now go to module carousel and a module to test layout at say content-top , set your test-page layout override to test and now go to domain.com/test-page and you will see carousel at the top, this is how layout works. what you previously doing was creating a new page by duplicating information controller and template.
A similar discussion on opencart forum Here

Orchard breadcrumbs not working with Taxonomies

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!

Any way of updating all links in spry menu bar in all pages?

I am currently designing an e-learning course for a college project. I am using a horizontal spry menu bar. I only have all updated links to other pages on the homepage. All of the rest are empty. I will finish up having more than 140 pages so is there anyway I can update the links from the homepage to work on all pages?
It would save me a huge amount of time.
Thanks.
There are two ways.
The first, and best, way is to call the menu code as some form of include on all pages of your site. You can put the ul structure of the menu system in a separate HTML file and use SSI or any server side language to call it as an include. If you don't have any access to SSI or a server side language, you can make the menu code a Dreamweaver Library Item and call it that way. The benefit here is the menu code exists in one place. Any update to the code will update throughout the site.
The second way is to use Dreamweaver's site-wide find and replace feature to make changes to the menu code on every page of your site.

Resources