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

Vote:
 

...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 ?

#45188
Nov 02, 2010 13:38
Vote:
 

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?

#45203
Nov 02, 2010 14:14
Vote:
 

I expected the following:

take this page structure:

StartPage

- 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 ?

#45208
Nov 02, 2010 15:46
Vote:
 

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.

#45209
Nov 02, 2010 15:50
Vote:
 

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).

#45210
Nov 02, 2010 15:54
Vote:
 

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?

#45211
Nov 02, 2010 15:58
Vote:
 

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

etc.

In neither case is the root page shown.

Is this not what you're getting?

#45212
Nov 02, 2010 16:10
Vote:
 

"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 ?

#45348
Nov 04, 2010 14:10
Vote:
 

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">
            <IndentTemplate>
                <ul>
            </IndentTemplate>
            <UnindentTemplate>
                </ul>
            </UnindentTemplate>
            <ItemTemplate>
                <li><EPiServer:Property PropertyName="PageName" runat="server"/></li>
            </ItemTemplate>
        </EPiServer:PageTree>
    
#45353
Nov 04, 2010 14:37
Vote:
 

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. (http://kreftregisteret.no)

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

Thanks for trying to help !

#45609
Nov 10, 2010 15:51
Vote:
 

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

#45612
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.