Vulnerability in EPiServer.Forms

Try our conversational search powered by Generative AI!

PageTree with ShowRootPage="false" won't display child pages


...unless I do an ExpandAll = true;

The PageTree is a submenu. When ShowRootPage = true, root page and all its children are displayed, when false then - nothing.

Any simple solutions ?

Nov 02, 2010 13:38

My understanding is that the PageTree expands to show the children around the CurrentPage.  ExpandAll will make everything expanding obvious.  If you do ShowRootPage, then it would also expand everything, since you are, by definition, in a child of the root page (any page is a child of the root page).

Exactly what do you want expanded, and what do you want collapsed?

Nov 02, 2010 14:14

I expected the following:

take this page structure:


- SubPage 1

  - SubSubPage 1.1

  - SubSubPage 1.2

- SubPage 2

- SubPage 3

.....I would expect my menu to render like:

- SubPage 1

- SubPage 2

- SubPage 3

when ShowRootPage = false. What I get is ...nothing... unless I do an ExpandAll = true; - but as you say, then all nodes on all levels show up.

- Am I missing something obvious ?

Nov 02, 2010 15:46

Not to answer your question with another question, but why use the PageTree property then?  Why not just use MenuList?  You essentially want the top-level nodes, right?  The direct children of Start Page?  There are easier ways to get that.

Nov 02, 2010 15:50

Well, I want a flat list of first-level pages when opening the root page for the first time (which isn't really the start page, it's a subpage). Then it will expand as the user clicks his way down the hierarchy.

Everything works as expected part from I can't get the root page not to display on top of the list. That was what I expected the ShowRootPage is meant for. It now hides both the root page and the child pages (leaving it empty).

Nov 02, 2010 15:54

Then it will expand as the user clicks his way down the hierarchy.

Expand as the user clicks from page to page, or expand dynamically in the client?

Nov 02, 2010 15:58

I did some testing.  My Start Page is Page ID #3.

With this:

<EPiServer:PageTree runat="server" ShowRootPage="false" ExpandAll="false" PageLink="3">

I get:

  • Page 1
  • Page 2
  • Page 3

With this:

<EPiServer:PageTree runat="server" ShowRootPage="false" ExpandAll="true" PageLink="3">

I get:

  • Page 1
    • Page 1.1
  • Page 2
    • Page 2.1
    • Page 2.2


In neither case is the root page shown.

Is this not what you're getting?

Nov 02, 2010 16:10

"In neither case is the root page shown.

Is this not what you're getting?"

No, and that's my frustration. If your hidden start page is named "StartPage" then I get:

  • StartPage
    • Page 1
    • Page 2

...when ShowRootPage = true, and

(nothing visible)

...when ShowRootPage = false.


How come ?

Nov 04, 2010 14:10

I'm sorry, but I don't know.  This is the not the behavior I'm seeing.

I used the code above with the default Public Templates demo site.  Here's the entire code section:

        <EPiServer:PageTree runat="server" ShowRootPage="false" ExpandAll="true" PageLink="3">
                <li><EPiServer:Property PropertyName="PageName" runat="server"/></li>
Nov 04, 2010 14:37

I am kind of embarassed - as the reason was the PageTree had no TopTemplate.

This way, only the expanded page (on the level below the root) would display. The site has this kind of linking main menu and submenu where only the selected item in the main menu (a "4x4" items list / "table") is displayed in the submenu. (

Well, anyway, I didn't see that one until today.

Thanks for trying to help !

Nov 10, 2010 15:51

I never would have thought of that.  Thanks for following up.

Nov 10, 2010 16:13
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.