Odoo 8 - Custom theme : show menu created from administration interface - menu

I'm creating a custom theme for an Odoo online shop. I need to have a main menu, which would be the one that comes by default with the website module, and a secondary menu that I want to display on all pages, somewhere below the main menu.
I created the secondary menu in the backend, this what it looks like :
The "Top Menu" is the default menu, it shows properly in the top right of the website's pages. I just can't figure out how to show the "Navigation" menu in my templates.
Copying this piece of code from the website module anywhere in my templates shows the "Top Menu" :
<t t-foreach="website.menu_id.child_id" t-as="submenu">
<t t-call="website.submenu"/>
</t>
So I guess this "Top Menu" is somehow associated to the website module right ? So do I need to "associate" the "Navigation" menu to my theme ? How would I do that ?
Or did I just do everything wrong ? I'm used to Wordpress' wp_nav_menu function with wich you can simply get a menu by its ID but maybe it's not the way to go with Odoo ? I'm having a hard time finding help on this matter in the doc or in forums.

Related

Liferay 7.3: How to make menu items in a theme controlled by admin

I have a liferay theme for version 7.3. I am facing one problem in the theme's menu.
Now menu has some static items. How can I change (add / remove) items dynamically by admin account?
The menu is added in /src/templates/portal_normal.ftl as
<#include "${full_templates_path}/menu-bar.ftl" />
this file has static html data.
Now how can I make it dynamic so that admin can change the menu items?
Make the menu as a web content, and drag it to the theme? Not makes sense because menu is the part of the theme.
Or any other way of picking the menu items, looping the items in .ftl and display it?
The times of scripting navigation and menus in the theme are over, and I'd rather recommend to embed a portlet in your theme that does the job. That might be a stock NavigationMenu portlet (see how Liferay's default "classic theme" does this with NavigationMenu or the SearchBar), or a custom one, which generates exactly what you'd like.
Reason: It's a lot simpler to redeploy a new portlet and generate/test appropriate HTML markup generation in a portlet than it is to implement proper error handling in a theme's freemarker script.
The solution can be if you want to add your data in navigation menu in themes, go into the navigation menus inside site builder in menu and create a new menu by clicking + button on top right and name the menu. Then go into the pages inside site builder inside menu. There will be a + sign on public pages. Click that and add a page that you want to list. If you want to create a submenu then on the page that is created, create a subpage by clicking there + sign. The page will be child and will be shown as a sub menu in theme.

How to link top-level "section" navigation items when using Zurb Foundation's top bar navigation component?

I am building a site using the Zurb Foundation UI framework, and I am wondering how to go about top-level navigation links so that they work for both desktop and mobile visitors.
EDIT: Here's an example: http://meowzen.com/zurb-nav/
Section 1 <-- should take the visitor to a "section" page
--Sub-Section 1 <-- should take the visitor to a "sub-section" page
--Sub-Section 2 <-- ditto
--etc
In the example via the link above, you'll notice that all links work as expected on a large screen. However, when the responsive navigation kicks in (either by resizing the window or viewing the page on a mobile device), the "section" pages aren't accessible through the menu anymore.
Has anyone come up against this problem? Do you have any suggestions on how to go about this?
Many thanks in advance!
EDIT: Here are some options I have at the moment:
Option 1: Only show top-level 'sections' for the mobile navigation - here's an example: projection . pixar . com . <- I'm leaning towards this!
Option 2: Make the section names linkable - I believe it's possible because there's a working example here: emerilsrestaurants . com .
Option 3: Insert a dummy menu item for the section pages at the sub-section level .
In the example via the link above, you'll notice that all links work as expected on a large screen. However, when the responsive navigation kicks in (either by resizing the window or viewing the page on a mobile device), the "section" pages aren't accessible through the menu anymore.
I am not sure I am understanding you correctly, but your example is working as expected. For smaller viewports ("mobile" view) the menu is hidden in a dropdown component. Once you drop down the menu, sub-menu items are still navegable on click.

Hide CRM form left hand side navigation item

I have my account entity linked to a custom entity called inspections, I only want these inspections to be created for accounts of a certain type. So when it isn't that type I want the left hand navigation to this entity to be hidden away. I've seen some code that says will hide it away, as long as you have the navID of the item.
I've had a crack at hiding it using what i thought could be the ID but it hasn't worked, so I'm wondering if anyone knows how to get this ID, or if there is another way to do this?
The code I'm using to hide the navigation is below:
var navitem = Xrm.Page.ui.navigation.items.get("nav_ts_inspection");
if (navitem != null)
{
navitem.setVisible(false);
}
Load the form
Press F12 to show IE Developer's Toolbar
From here you can use CTRL+F to search for the display name of the item you'd like to hide. This will give you a link that is generated. The Id of this element is what you need to use to show/hide the link.
As an example, you can see results of searching for 'Sub Accounts' on the Account screen for an installation I am working on at the moment. The Id can be seen and is 'navSubAct'
Changes by traversing DOM and manually hide an area is not officially supported.
Luckily if you are on CRM 2011, you can go to
Settings > Customization Or open the solution.
Select the entity > Forms. Inside the Form editor window, open the Form Properties of the entity.
Go to Display Tab and untick "Show navigation items" checkbox.
Finally do not forget to Publish your changes.
Use the relationshipname to hide folder in navigation like this:
If you have folder with the relationship name: ts_inspection
Use this for ID: navts_inspection
So otherwise the same as above, but lose the extra underscore (_) between nav and ts.
var navitem = Xrm.Page.ui.navigation.items.get("navts_inspection");
If you want to hide particular navigation section from the FORM then remove all the links from that section and publish it. That section will not be visible anymore.
If you want to just remove Navigation Pane from FORM, then go to 'Display' tab of form and mark as 'Do Not Show' and then publish it.

Show Title in MonoTouch tabbed application

Maybe I'm missing something super simple, but I can't seem to get a title to show up at the top of Views contained within a basic tabbed application. I follow these steps...
New Solution, Universal Storyboard, Tabbed Application
Run that and you have two basic Views "First View" and "Second View".
Neither View by default has a title bar, but the default code shows setting a this.Title.
Why don't the title bars show up? How do I get them to show? I've tried several things to get these to show such as...
Setting "Top Bar" in Interface Builder to "Navigation Bar". It then shows in Interface Builder but never shows on runtime.
I've also tried in ViewDidLoad() to set this.TabBarController.Title but that doesn't seem to do anything either.
Thoughts?
The feature you are looking for is called a NavigationBar and can be added manually via IB to your view if it does not have a NavigationController associated with it. If there is a navigation controller then the NavigationBar will show up automatically.
So to answer your question if you want a NavigationBar go to IB and add one from the objects library you should then be able to manipulate the Title on the nav bar to your hearts content.

How to add subpages in Orchard CMS

I added a new page in the main menu, e.g. Products. Now I want to add a subpage e.g. Sub Products below a Products page. I tried all possible options in the dashboard but it didn't work for me. Any ideas how to handle this?
Thanks.
here is a quick solution for this
Go to your dash board -->Gallery -->Modules
search for Hierarchical menu and install it
after installing then go to Configuration -->Features and enable it.
Go go to Navigation .give position like 2 for "Products" and 2.1 for "Sub products".
you will see Sub products appear under Products page.
As of Orchard CMS 1.5 this is supported by the core navigation module. Now you can simply drag and drop menu items under one another in the Admin -> Navigation view. You can then control level rendering under the widget settings for the menu by setting the "Start level" and "Levels to display" properties.
See release notes for further details.
The navigation documentation doesn't seem to be up to date though :(
Take a look at: http://orchard.codeplex.com/Thread/View.aspx?ThreadId=242327
The module to support this (along with many other modules) is available in Orchard's module gallery.

Resources