Hi, I'm working on a site that has its own theme and its own plugins but also I'm using some from community like this one (MenuManager). So I made a layout.htm
with this content (my apologies for leaving the code in a external link but I think the code has a few lines so as not to make the post so long I place it beyond). Now if you notice when I add the component it add some code at layout top, this code:
[menu]
start = "id-1"
activeNode = "id-1"
listItemClasses = "item"
primaryClasses = "nav nav-pills"
secondaryClasses = "dropdown-menu"
numberOfLevels = "2"
And also if you take a look you'll see the component itself:
<div class="navbar-collapse collapse">
{% component 'menu' %}
</div>
But for some reason it's not displayed when I load the page, why? What I'm doing wrong?
Not sure. I've had a look at the gist and it seems fine.
When I get a chance I'll try and replicate the problem. What version of OctoberCMS is it currently running?
Hi @benfreke nevermind I found where my error was, I was displaying the first menu which have not any children and for that reason the menu wasn't displayed. I fixed few hours ago. Now it's possible to add support for user permissions level? Lets said I want to show a menu only if the user is logged in, is that possible? how?
I've not played with the user levels, but if you wrap the component tag in a tag to check if the user is logged in that'd do the trick.
Definitely not possible to define it on an individual menu item though.
I had a problem similar to @reynierpm, I attached menu component to layout. And I got nothing render.
default.htm
description = "Default layout"
[menu header_menu]
start = "id-1"
activeNode = "id-1"
listItemClasses = "scroll"
primaryClasses = "nav navbar-nav"
secondaryClasses = "dropdown-menu"
numberOfLevels = 1
==
nav.htm
<div class="collapse navbar-collapse navbar-right">
{% component "header_menu" %}
</div>
I have followed many instruction but it still didn't render.
Regards,
semsphy said:
I had a problem similar to @reynierpm, I attached menu component to layout. And I got nothing render.
default.htm
description = "Default layout"
[menu header_menu] start = "id-1" activeNode = "id-1" listItemClasses = "scroll" primaryClasses = "nav navbar-nav" secondaryClasses = "dropdown-menu" numberOfLevels = 1
nav.htm
I have followed many instruction but it still didn't render.
Regards,
Hi
Without knowing all the details, each component is separate. If you put the component information at the top of the nav.htm page, does it then work?
I don't believe it is possible for a component to be defined in one view, and then shown in another.
Thank for your reply. Now I put the component in nav.htm
, nav.htm
is partial.
[menu header_menu]
start = "id-1"
activeNode = "id-1"
listItemClasses = "scroll"
primaryClasses = "nav navbar-nav"
secondaryClasses = "dropdown-menu"
numberOfLevels = 1
==
It still didn't render.
The only other thing that comes to mind then is that there is no node with an id of 1. If there is, then you may need to look in to the error logs to see what else is going wrong sorry.
Would you please check my default.htm?
There is something wrong. Honestly, I don't know where to put node id.
Regards,
The template looks fine.
I'm at work so I don't have access to a working installation, so I'm going completely off memory here. Which menu item has the ID of 1? You can check the database for that, or I believe when mousing over items in the admin the URL that displays will have the node ID. If you've been changing, or moving, or editing individual items, you may very well not have a menu with the id of 1.
More information:
"require": {
"php": ">=5.4",
"october/rain": "~1.0",
"october/system": "~1.0",
"october/backend": "~1.0",
"october/cms": "~1.0",
"laravel/framework": "5.0.*",
"illuminate/html": "5.0.*"
}
Here are the urls:
- HOME -> /backend/benfreke/menumanager/menus/update/1
- ABOUT -> /backend/benfreke/menumanager/menus/update/2
Regards,
Last updated
I see your problem. Please review the documentation on how this plugin works.
Basically, the node you select as the start node is the parent. The menu will only display the children of that node. So, create another node and then next home and about underneath that new node. Change the start node to be id-3 and you should be good to go.
1-13 of 13