Here more info: https://groups.google.com/forum/#!topic/django-cms/2bjFhOhF8qY/discussion
From that thread:
After an app integration I'm try to extend menu (with specified ID) with links to views of my app. I'm use for this Navigation Modifiers.
Here code of meny.py:
from menus.base import Modifier, NavigationNode
from menus.menu_pool import menu_pool
name = 'mymenu'
def modify(self, request, nodes, namespace, root_id, post_cut, breadcrumb):
if post_cut: return nodes
if root_id == 'top_menu':
nodes.append(NavigationNode('test', '/', 1))
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from standard_projects.menu import MyNode
from django.utils.translation import ugettext_lazy as _
name = _('Standard projects')
urls = ['standard_projects.urls']
menu = [MyNode]
And when I try access a page with this menu, django crash with Error:
Caught AttributeError while rendering: 'NavigationNode' object has no attribute 'selected'
When I try to print dir(nodes) in modify function of MyMenu, it's show NavigationNodes with this attribute, but when I try do this with my newly created node, it doesn't have this attribute.
What I'm doing wrong? Maybe here another ways to extend menu with specified ID?
Now you're doing a thing here that was never intended to be done, adding navigation nodes in modifiers. Modifiers should just alter existing navigation nodes, while navigation nodes should be attached using Menu/CMSAttachMenu subclasses.
Therefore I'll close this as a WONTFIX for now
Note that while it may not have been intended to be done, the documentation has always been rather ambiguous - it talked of adding and changing properties, but those without a keen understanding of the underlying intention may not have understood that correctly.
However, in the develop docs it now explicitly says that adding navigation nodes via a modifier is OK. I wonder: Is that intentional (and a change in stance) or an error in the updated docs?
This might indeed be a documentation issue
I too fell into this documentation trap on latest.
While this f7757f4 says it can change existing, the docs implies Modifier can be used to add new nodes as well or at least it's not explicit.