[Hippo-cms7-user] Repository based sitemenu configuration

Ard Schrijvers a.schrijvers at onehippo.com
Mon Oct 10 15:27:18 CEST 2011


On Sun, Oct 9, 2011 at 11:04 PM, Brian Snijders <brian at finalist.nl> wrote:
> Hi all,
>
> Got a small question concerning repository based navigation for building
> up sitemenus.
>
> I've defined a parentnode having hst:repobased=true and hst:depth=2. In
> my component, I'm creating an editable menu instance, such that I can
> add the repository documents to the sitemenu.
>
> Now I'm facing a strange situation, using the following piece of code:
>
> EditableMenu editableMenu = mainMenu.getEditableMenu();
> EditableMenuItem item = editableMenu.getDeepestExpandedItem();
>
> log.info(mainMenu.getDeepestExpandedItem().isRepositoryBased());
> log.info(editableMenu.getDeepestExpandedItem().isRepositoryBased());
>
> I'd expect both loglines to display the same value. However my
> (read-only) mainmenu correctly displays 'true'. My editable menu, which
> is some kind of copy I presume displays 'false'.
>
> I don't know whether this is a bug or a misconfiguration on my side. Can
> somebody please confirm or help out?

I think with editableMenu.getDeepestExpandedItem().isRepositoryBased()
you are probably getting an EditableMenuItem you added yourself,
right? For example, I assume that mainMenu.getDeepestExpandedItem()
also returns a complete different menu item than
editableMenu.getDeepestExpandedItem(). Log the name of the item for
example.

Now, also note, that you control yourself how the repository based
editableMenuItem are added. You create them yourself (look for example
in the HST demo suite project at DemoRepoBasedMenuItem). This
DemoRepoBasedMenuItem impl has in its constructor:

this.repositoryBased = true;

most likely, you will need something similar.

Look at the demosuite, that should help

Regards Ard

>
> Many thanks in advance, since this is quite vital to the project I'm
> on...
>
> --
> Met vriendelijke groet,
>
> Brian Snijders
> Software Engineer
>
> Finalist -  open IT oplossingen
> Rotterdam - Amsterdam - Eindhoven
> www.finalist.nl
>
> Telefoon: +31 88 217 08 43
> Mobiel: +31 6 455 400 83
>
>
>
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html
>



-- 
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com



More information about the Hippo-cms7-user mailing list