Working with Web Part Pages Tip #3 - Making your navigation control expandable
The title on these posts is getting long, must be snappier!
This is the third post in my “Working with Web Part Pages” series, and in this post I will step through how to group together pages by creating an “expanding/collapsing” style navigation. This becomes important as the number of pages in your site grows, consuming ever more space as displayed below:
It also makes navigation more intuitive by grouping together related pages. So lets get started:
1. In your browser open the document library where your pages are stored, in my case it’s the “Pages” document library.
2. Click on the “Modify Settings and Columns” link
Here we need to create a new column that can be used to group the pages.
3. Click on “Add a new column” in the “Columns” section to reveal the following screen:
4. Enter in a column name, for example I will be creating a column called “Group”. I’m also going to make it a choice field with the following choices:
That way we can restrict they way the pages are grouped.
5. After clicking “OK” you will be returned to the “Modify Settings and Columns” page, here click on “Create a New View” in the “Views” section.
6. On the “Create View” page select “Standard View” to reveal the following page:
7. Enter a new name for the view, for example “Grouped View” and select the columns you want displayed. In my case I simply selected “Type” and “Name”, un-selecting all others.
The important thing to note here is that you do not have to display the field we will be grouping on.
8. Expand the “Group By” section, and then select the field created in Step 3 above from the drop-down menu. In my example I’m also choosing to display groups “collapsed” by default.
9. When you have finished, click on the “OK” button, and then return to the document library.
10. You now need to enter a value in the group column for each of the existing Web Part Pages.
A very important note here, is that by doing this you will actually be “Un-ghosting” the pages, I discovered this the very hard way <grin>. Maurice actually did a post on this very topic just recently, and it’s worth reading, in fact while you are there follow the links to the earlier posts whole issue of “Ghosting”.
Yes, this “un-ghosting” does make life difficult, in a later tip in the series I will talk about how we dealt with this in a large deployment that I worked on.
All that remains is to:
11. Return to the page containing your previously created navigation web part.
12. Modify the “Pages” web part via the “Modify Shared Web Part” option contained in the parts drop-down.
13. Choose your newly created view in the “Select View” drop-down:
14. Click “OK”, and dance a jig when you see the following:
15. And do some clicking:
Stay tuned for the next exciting Web Part Page installment!