How to pin Home page?

XWiki 16.10.9

I’ve found and tried the Pinned pages feature, for several pages.

But how do I pin the Home wiki page i.e. xwiki/bin/view/Main/ so that it appears as first entry in the Navigation Panel?

By pinning it :slight_smile:

See for example (AAA should be listed first but it’s not since I pinned Home):

Sorry, missed your reply!

I probably tried before asking, though didn’t mention it; looks like there’s no Home here.

I noticed Home has “Main” in its path, and in fact if I search for: “Mai”, Home shows up:

Pinned!

Seems like a bug as it should search in page titles too! cc @mflorea

I’ve noticed that if you type “main” as you did, select it, then remove it, and try again with “Hom” it works… so it seems there’s a bug somewhere.

Thanks

1 Like

Thanks :slight_smile:

Hi,

First of all, for top level pages you should use the Navigation Panel administration section (just above the Pinned Pages section) which allows you to order the top level pages using drag & drop.

Regarding the Pinned Pages section, I just tested with XWiki 16.10.12, and I get this PrivateBin , i.e. when the suggest input is focused some of the child pages are already displayed, including “Home”, so I can select it. Typing “Hom” also finds the page.

There is a catch though. The suggest input from the Pinned Pages section uses either the WikiChildrenResource (for top level pages) or the PageChildrenResource (for nested pages) REST API to fetch the child pages, and both are using the NestedPagesPageHierarchy component under the hood. This component is currently performing a database query, which matches only the page name. Even if it would match the title, it would be the raw title, which may contain unevaluated Velocity code. I was able to find “Home” when typing “Hom” because this page was already loaded with that initial request made when the suggest input was focused. But if there are many child pages, not all of them will be loaded with that initial request, so for the remaining you currently have to match the page name not its title. It’s more of a limitation than a bug. Note that matching the page title with a database query is not as trivial as it may seem, because you need to match the title of the document translation matching the current locale or the default locale if a translation is missing, and for nested child pages this means looking for the space home page, which in some cases may be missing, so a fallback is needed. The document tree uses some complex native SQL queries to achieve this… It would be simpler to use Solr, but not as reliable, because the index might not be ready.

Thanks,
Marius

1 Like

What is a bug to me is the “magic” part from a user POV, i.e. sometimes it works when typing part of the page title and sometimes it doesn’t. I’d say that we need consistency and a hint that explains what to type.

Thx for the explanations!