none
SharePoint 2010 Subpage Menus

    Question

  • Hello,

    Currently I am moving my company's wiki to a SharePoint site. As the title suggests, the wiki I am moving the information from has subpages. What I mean by that is it goes something like this:

    Help > About > About Item 2 > Item 2 Documentation > Item 2 (Random)
                                              > Item 3 Documentation > Item 3 (Random)

    And so on. What I am trying to figure out is how can I create a menu on SharePoint that allows me to link to those pages without having to put it inside another page?

    Currently, for example, this is our test SharePoint site. As you can see in the image (Sorry for the crap quality) I have the links to a new page on a page itself. But, if I have information on that page, yet need to link to another subpage, I obviously can't have a link to that page randomly on it.

    http://img135.imageshack.us/img135/2203/menuse.jpg

    Sorry if I made it a bit confusing. Hopefully it is clear enough. If not, let me know. I'll do my best to clear up any misunderstandings.

    This is with SharePoint 2010 Foundation, too. We're planning on upgrading to Standard soon.

    Thanks for the help.

    Edit: Added a small piece.
    Wednesday, March 30, 2011 8:27 PM

Answers

  • Hi Geikeon,

    It seems that you want to generate a link randomly at the level of ‘Item 2 Documentation’ you mentioned in wiki page. If my understand is right, you could try to make use of javascript to fix it.

    For example, in the wiki home page and it has a subpage named ‘How to use this library’ with an Id attribute(and id value is 0::How To Use This Library|How To Use This Library).

    I assume that the current url is ‘http://wjc:1130/WIKI/Home.aspx’, then add ‘?ToolPaneView=2’ to the end of that.

    Add a ContentEditor webpart. Click it and edit its html source. Write the following javascript code snippet.

        <script type="text/javascript">

            var links = ["/WIKI/How%20To%20Use%20This%20Library.aspx", "/WIKI/Home.aspx"];

            links.sort(function () { return Math.random() > 0.5 ? -1 : 1; });

            _spBodyOnLoadFunctionNames.push("setPageLink");

            function setPageLink() {

                var pageLink = document.getElementById("0::How To Use This Library|How To Use This Library");

                pageLink.setAttribute("href", links[0]);

            }

        </script>

     

    Thanks,

    Porter Wang

    • Marked as answer by KeFang Chen Thursday, April 14, 2011 2:13 AM
    Wednesday, April 06, 2011 7:57 AM

All replies

  • Hi Geikeon,

    It seems that you want to generate a link randomly at the level of ‘Item 2 Documentation’ you mentioned in wiki page. If my understand is right, you could try to make use of javascript to fix it.

    For example, in the wiki home page and it has a subpage named ‘How to use this library’ with an Id attribute(and id value is 0::How To Use This Library|How To Use This Library).

    I assume that the current url is ‘http://wjc:1130/WIKI/Home.aspx’, then add ‘?ToolPaneView=2’ to the end of that.

    Add a ContentEditor webpart. Click it and edit its html source. Write the following javascript code snippet.

        <script type="text/javascript">

            var links = ["/WIKI/How%20To%20Use%20This%20Library.aspx", "/WIKI/Home.aspx"];

            links.sort(function () { return Math.random() > 0.5 ? -1 : 1; });

            _spBodyOnLoadFunctionNames.push("setPageLink");

            function setPageLink() {

                var pageLink = document.getElementById("0::How To Use This Library|How To Use This Library");

                pageLink.setAttribute("href", links[0]);

            }

        </script>

     

    Thanks,

    Porter Wang

    • Marked as answer by KeFang Chen Thursday, April 14, 2011 2:13 AM
    Wednesday, April 06, 2011 7:57 AM
  • Thank you for responding. I will try this out when I get the chance. Currently I haven't upgraded to SharePoint Standard yet so I cannot add a ContentEditor Webpart yet. I will let you know when I can confirm this.
    Thursday, April 07, 2011 3:28 PM