2

I a custom site definition, I have two modules :

  • the classic default module to provision the default.aspx
  • a custom mypage to provision a custom mypage.aspx

I want to add in the top navigation bar a link to this page. So I set up my module like this, according the documentation:

    <Module Name="MyPage"
            Url="">
        <File
            Url="mypage.aspx"
            Type="Ghostable">
            <View List="Lists/mylist"
                  BaseViewID="0"
                  WebPartZoneID="Left"
                 />

            <NavBarPage Name="My custom page"
                        ID="1002"
                        Position="End" />
            <NavBarPage Name="My custom page"
                        ID="0"
                        Position="Start" />
        </File>
    </Module>

the pages are provisioned successfully, but the top nav bar is broken and empty. Is it the correct way to add a link in the top bar ?

  • If you solved the Q youself, please add as answer and mark as answer when you can – Anders Rask Jun 20 '11 at 19:03
  • @Anders Rask: the actual issue is solved, but I'm still wondering what is the source of the issue... how can I deal with that ? – Steve B Jun 20 '11 at 19:13
0

I can redefined the navbars like this :

<NavBars>
    <NavBar Name="$Resources:core,category_Top;"
            Separator="&amp;nbsp;&amp;nbsp;&amp;nbsp;"
            Body="&lt;a ID='onettopnavbar#LABEL_ID#' href='#URL#' accesskey='J'&gt;#LABEL#&lt;/a&gt;"
            ID="1002" />
    <NavBar Name="$Resources:core,category_Documents;"
            Prefix="&lt;table border='0' cellpadding='4' cellspacing='0'&gt;"
            Body="&lt;tr&gt;&lt;td&gt;&lt;table border='0' cellpadding='0' cellspacing='0'&gt;&lt;tr&gt;&lt;td&gt;&lt;img src='/_layouts/images/blank.gif' id='100' alt='' border='0'&gt;&amp;nbsp;&lt;/td&gt;&lt;td valign='top'&gt;&lt;a id='onetleftnavbar#LABEL_ID#' href='#URL#'&gt;#LABEL#&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;"
            Suffix="&lt;/table&gt;"
            ID="1004" />
    <NavBar Name="$Resources:core,category_Lists;"
            Prefix="&lt;table border='0' cellpadding='4' cellspacing='0'&gt;"
            Body="&lt;tr&gt;&lt;td&gt;&lt;table border='0' cellpadding='0' cellspacing='0'&gt;&lt;tr&gt;&lt;td&gt;&lt;img src='/_layouts/images/blank.gif' id='100' alt='' border='0'&gt;&amp;nbsp;&lt;/td&gt;&lt;td valign='top'&gt;&lt;a id='onetleftnavbar#LABEL_ID#' href='#URL#'&gt;#LABEL#&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;"
            Suffix="&lt;/table&gt;"
            ID="1003" />
    <NavBar Name="$Resources:core,category_Discussions;"
            Prefix="&lt;table border='0' cellpadding='4' cellspacing='0'&gt;"
            Body="&lt;tr&gt;&lt;td&gt;&lt;table border='0' cellpadding='0' cellspacing='0'&gt;&lt;tr&gt;&lt;td&gt;&lt;img src='/_layouts/images/blank.gif' id='100' alt='' border='0'&gt;&amp;nbsp;&lt;/td&gt;&lt;td valign='top'&gt;&lt;a id='onetleftnavbar#LABEL_ID#' href='#URL#'&gt;#LABEL#&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;"
            Suffix="&lt;/table&gt;"
            ID="1006" />
</NavBars>

But I don't understand why it's a prerequisite for my link to work

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.