Project

General

Profile

How to allow bookmarking for submenu items

Added by Alexey Chemakin over 10 years ago

Hi!

I have such a code:

// The function for menu items creating.
WMenuItem *addMenuItem(WMenu *_menu, const char *_itemKey,
                 const char *_contentsKey, const char *_path = 0, WMenu *_subMenu = 0)
{
  WMenuItem *menuItem = _menu->addItem(WString::tr(_itemKey), new WText(WString::tr(_contentsKey)));
  if (_path)
    menuItem->setPathComponent(_path);
  if (_subMenu) {
    menuItem->setMenu(_subMenu);
  }
  return menuItem;
}

...
...
m_mainMenu = new WMenu(contents);
m_mainMenu->setInternalPathEnabled("/");
WMenu *submenu = new WMenu(contents);

submenu->setInternalPathEnabled("aboutPortal");
curItem = addMenuItem(submenu, "portalRules.menu", "portalRules.text", "prules");
curItem->setInternalPathEnabled(true);

addMenuItem(m_mainMenu, "aboutPortal.menu", "aboutPortal.text", "aboutPortal", submenu);

When I enter "http://localhost/?_=/aboutPortal/prules" in browser, my site shows page for "http://localhost/?_=/aboutPortal".

How should I correct my code to allow bookmarking for "http://localhost/?_=/aboutPortal/prules" page?

WBR,

Alexey