Click here to Skip to main content
15,886,362 members
Articles / Web Development / ASP.NET

SharePoint Page Navigation Web Part

Rate me:
Please Sign up or sign in to vote.
4.56/5 (4 votes)
25 Mar 2009CPOL6 min read 126.9K   540   19  
Web Part for users to drop on their pages for navigation across the site collection.
<br />
<div>
<table cellspacing="0" cellpadding="0" border="0" style="width:0px; width:100%;border-collapse:collapse;">
	<tr>
		<td>
            <div class="UserSectionTitle">
                <a id="{0}_NavigationCategory_IMAGEANCHOR" TabIndex="0" onkeydown='MSOMenu_KeyboardClick(this, 13, 32);' 
                style='cursor:hand' 
                onclick="javascript:MSOTlPn_ToggleDisplay('{0}_NavigationCategory', '{0}_NavigationCategory_IMAGE', '{0}_NavigationCategory_ANCHOR', 'Expand category: Navigation', 'Collapse category: Navigation','{0}_NavigationCategory_IMAGEANCHOR');" 
                title="Collapse category: Navigation" >
                    &nbsp;<img id="{0}_NavigationCategory_IMAGE" alt="Collapse category: Navigation" border="0" src="/_layouts/images/TPMin2.gif" />&nbsp;
                </a>
                <a TabIndex="-1" 
                    onkeydown='MSOMenu_KeyboardClick(this, 13, 32);' 
                    id="{0}_NavigationCategory_ANCHOR" 
                    style='cursor:hand' 
                    onclick="javascript:MSOTlPn_ToggleDisplay('{0}_NavigationCategory', '{0}_NavigationCategory_IMAGE', '{0}_NavigationCategory_ANCHOR', 'Expand category: Navigation', 'Collapse category: Navigation','{0}_NavigationCategory_IMAGEANCHOR');" 
                    title="Collapse category: Navigation" >&nbsp;Navigation
                </a>
            </div>
        </td>
    </tr>
</table>
<div id="{0}_NavigationCategory">
    <div id="{0}_LinkList">
        <select size="4" 
            id="{0}_lnwpListBox" 
            ondblclick="LPNW_EditSelectedItem('{1}','{0}');" 
            style="width:90%;height:200px;" >
        </select>
        <br />
        <a style="cursor:pointer;padding-left:5px;" href="javascript:LPNW_EditSelectedItem('{1}','{0}');">
            <img alt="Edit Link" src="{6}" border="0" />
        </a>
        <a style="cursor:pointer;padding-left:5px;" href="javascript:LPNW_AddNewItemToListBox('{1}','{0}');">
            <img alt="Add Link" src="{2}" border="0" />
        </a>
        <a style="cursor:pointer;padding-left:5px;" href="javascript:LPNW_RemoveSelectedItemInListBox('{1}','{0}');">
            <img alt="Remove Link" src="{3}" border=""0"" />
        </a>
        <a style="cursor:pointer;padding-left:5px;" href="javascript:LPNW_MoveSelectedItemUp('{1}','{0}');">
            <img alt="Move Link Up" src="{4}" border="0" />
        </a>
        <a style="cursor:pointer;padding-left:5px;" href="javascript:LPNW_MoveSelectedItemDown('{1}','{0}');">
            <img alt="Move Link Down" src="{5}" border="0" />
        </a>  
    </div>
    <div id="{0}_LinkEditForm" style="display:none;">    
	<table cellspacing="0" border="0" style="border-width:0px;width:100%;border-collapse:collapse;">
		<!-- Edit Title Start -->
		<tr>
			<td>
			    <div class="UserSectionHead">
			        <LABEL FOR="{0}_Title_EDITOR" 
			               TITLE="The title of your link. If left empty the the list name will be used.">Title
			        </LABEL>
			    </div>
			    <div class="UserSectionBody">
			        <div class="UserControlGroup">
			            <nobr>
			                <input type="text" value="" id="{0}_Title_EDITOR" 
			                    class="UserInput" 
			                    ms-TlPnWiden="true" 
			                    onfocusin="MSOPGrid_BuilderVisible({0}_Title_BUILDER)" 
			                    ondeactivate="MSOTlPn_prevBuilder={0}_Title_BUILDER;" 
			                    style="width:176px;" />&nbsp;
			                <input type="button" 
			                    id="{0}_Title_BUILDER" 
			                    value="..." 
			                    title="Click to use builder" 
			                    tabindex="0" 
			                    class="ms-PropGridBuilderButton" 
			                    onfocusout="this.style.display='none';" 
			                    onclick="javascript:MSOPGrid_doBuilder('\u002f_layouts\u002fzoombldr.aspx?culture=en-US', {0}_Title_EDITOR, 'dialogHeight:340px;dialogWidth:430px;help:no;status:no;resizable:yes')" />
			            </nobr>
			        </div>
			    </div>
			    <div style='width:100%' class='UserDottedLine'>
			    </div>
		    </td>
	    </tr>
	    <!-- Edit Title End -->
	    <!-- Edit ListUrl Start -->
		<tr>
			<td>
			    <div class="UserSectionHead">
			        <LABEL FOR="{0}_ListUrl_EDITOR" 
			               TITLE="The relative url of the list that you would like to query.">List Url
			        </LABEL>
			    </div>
			    <div class="UserSectionBody">
			        <div class="UserControlGroup">
			                <table cellpadding="0" cellspacing="0" border="0">
			                    <tr style="text-align:left">
			                        <td>
			                            <input type="text" value="" id="{0}_ListUrl_EDITOR" 
			                                class="UserInput" 
			                                ms-TlPnWiden="true"
			                                style="width:176px;"
			                                disabled="disabled" />
			                        </td>
			                    </tr>
			                    <tr style="text-align:right">
			                        <td><input type="button" 
			                                id="{0}_ListUrl_BUILDER" 
			                                value="Browse..." 
			                                title="Click to use list picker." 
			                                tabindex="0" 
			                                class="ms-PropGridBuilderButton" 
			                                style="display:inline;cursor:pointer;width:55px;text-align:center"
			                                onclick="javascript:LPNW_LaunchListPicker('{1}','{0}', '{7}')" />
			                        </td>
			                    </tr>
			                </table>
			        </div>
			    </div>
			    <div style='width:100%' class='UserDottedLine'>
			    </div>
		    </td>
	    </tr>
	    <!-- Edit ListName End -->
	    <!-- Edit DisplayField Start -->
		<tr>
			<td>
			    <div class="UserSectionHead">
			        <LABEL FOR="{0}_DisplayField_EDITOR" 
			               TITLE="The internal name for the field that you would like the link to display.">Display Field
			        </LABEL>
			    </div>
			    <div class="UserSectionBody">
			        <div class="UserControlGroup">
			            <nobr>
			                <input type="text" value="" id="{0}_DisplayField_EDITOR" 
			                    class="UserInput" 
			                    ms-TlPnWiden="true" 
			                    onfocusin="MSOPGrid_BuilderVisible({0}_DisplayField_BUILDER)" 
			                    ondeactivate="MSOTlPn_prevBuilder={0}_DisplayField_BUILDER;" 
			                    style="width:176px;" />&nbsp;
			                <input type="button" 
			                    id="{0}_DisplayField_BUILDER" 
			                    value="..." 
			                    title="Click to use builder" 
			                    tabindex="0" 
			                    class="ms-PropGridBuilderButton" 
			                    onfocusout="this.style.display='none';" 
			                    onclick="javascript:MSOPGrid_doBuilder('\u002f_layouts\u002fzoombldr.aspx?culture=en-US', {0}_DisplayField_EDITOR, 'dialogHeight:340px;dialogWidth:430px;help:no;status:no;resizable:yes')" />
			            </nobr>
			        </div>
			    </div>
			    <div style='width:100%' class='UserDottedLine'>
			    </div>
		    </td>
	    </tr>
	    <!-- Edit DisplayField End -->
	    <!-- Edit Query Start -->
		<tr>
			<td>
			    <div class="UserSectionHead">
			        <LABEL FOR="{0}_Query_EDITOR" 
			               TITLE="The CAML Query that will be used to query the list.">Query
			        </LABEL>
			    </div>
			    <div class="UserSectionBody">
			        <div class="UserControlGroup">
			                <table cellpadding="0" cellspacing="0" border="0">
			                    <tr style="text-align:left">
			                        <td>
			                            <input type="text" value="" id="{0}_Query_EDITOR" 
			                                class="UserInput" 
			                                ms-TlPnWiden="true"
			                                style="width:176px;" />
			                        </td>
			                    </tr>
			                    <tr style="text-align:right">
			                        <td><input type="button" 
			                                id="{0}_Query_BUILDER" 
			                                value="Build..." 
			                                title="Click to use the query builder." 
			                                tabindex="0" 
			                                class="ms-PropGridBuilderButton" 
			                                style="display:inline;cursor:pointer;width:55px;text-align:center"
			                                onclick="javascript:LPNW_LaunchQueryBuilder('{1}','{0}', '{7}')" />
			                        </td>
			                    </tr>
			                </table>
			        </div>
			    </div>
		    </td>
	    </tr>
	    <!-- Edit Query End -->
	    <!-- Edit Hidden Id Field Start -->
		<tr style="display:none">
			<td>
			    <input type="text" value="" id="{0}_Id"  />
		    </td>
	    </tr>
	    <!-- Edit HiddenId Field End -->
	    <tr>
	        <td style="text-align:right;padding-right:5px;">
	            <input id="{0}_btnEditOk"
	                   type="button"
			           value="OK" 
			           title="Click to save link." 
			           tabindex="0" 
			           class="ms-PropGridBuilderButton"
			           style="display:inline;cursor:pointer;width:45px;text-align:center" />
			           
			    &nbsp;
			           
			    <input type="button"
			           value="Cancel" 
			           title="Click to cancel edit." 
			           tabindex="0" 
			           class="ms-PropGridBuilderButton" 
			           style="display:inline;cursor:pointer;width:45px;text-align:center" 
			           onclick="javascript:LPNW_CancelEditOrAdd('{0}');" />
	        </td>
	    </tr>
    </table>
    </div>
</div>		
</div>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions