Search This Blog

Showing posts with label SharePoint 2010. Show all posts
Showing posts with label SharePoint 2010. Show all posts

Friday, December 17, 2010

[Troubleshooting] SharePoint 2010 MasterPage Custom Top Navigation Issue

Do you face any problem to the top navigation link where you have added a custom link but end up it return you node and however you click and it gonna redirect you back to your root site… irony?

Please check if you are using this format? This is no problem when you are in SP2007, but SP2010 you will understand what i mean.

<SharePoint:AspMenu
                    ID="TopNavigationMenuV4"
                    Runat="server"
                    EnableViewState="false"
                    DataSourceID="topSiteMap"
                    AccessKey="<%$Resources:wss,navigation_accesskey%>"                 
                    Orientation="Horizontal"
                    StaticDisplayLevels="2"
                    StaticSelectedStyle-CssClass="xxxx"
                    MaximumDynamicDisplayLevels="1"
                    SkipLinkText=""
                    StaticEnableDefaultPopOutImage="False"              
                    CssClass="atq-topnav">    
                    <DynamicMenuStyle CssClass="xxx" />              
                    <DynamicMenuItemStyle CssClass="xxx" />                   
                    <DynamicHoverStyle CssClass="xxx"/>
                    <StaticItemTemplate>
                        <table  cellpadding="0" cellspacing="0">
                               <tr>                          
                                <td>

                                   <asp:HyperLink runat="Server" ID="LinkMenuItem" NavigateUrl='<%# Eval("DataPath")%>' Text='<%# Eval("Text")%>' /></td>
                                    </tr>
                        </table>
                    </StaticItemTemplate>
                </SharePoint:AspMenu>

VS.

Change the syntax as follow and you will able to solve the “unreachable” link issue.

<SharePoint:AspMenu
                            ID="TopNavigationMenuV4"
                            Runat="server"
                            EnableViewState="false"
                            DataSourceID="topSiteMap"
                            AccessKey="<%$Resources:wss,navigation_accesskey%>"
                            Orientation="Horizontal"
                            StaticDisplayLevels="2"
                            StaticSelectedStyle-CssClass="xxx"
                            MaximumDynamicDisplayLevels="1"
                            SkipLinkText=""
                            CssClass="s4-tn">
                            <StaticItemTemplate>

<table onclick="window.location=this.parentNode.href" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td>

                                             <asp:Label runat="server" id="a1" text='<%# Eval("Text")%>'></asp:Label>     
                                        </td>
                                    </tr>
                                </table>
                            </StaticItemTemplate>
                        </SharePoint:AspMenu>

Tuesday, October 12, 2010

[Tip] Sometime is hard to say i’m sorry SharePoint 2010

Have you ever face any problem when trying out with no bugs for your SP 2010 master page top navigation? impossible right? The followings are some knowledge sharing from me, hope it helps you…Sp2010 is damn “good”~!

image

It’s auto generated width:3px td in table for each single menu item.

It’s auto generate margin-left: 16px for each single menu item.

Solution :
Look for the AspMenu and add few attributes to the control so that it won’t render the extra pixel on our design…
<SharePoint:AspMenu
                    ID="TopNavigationMenuV4"
                    Runat="server"
                    EnableViewState="false"
                    DataSourceID="topSiteMap"
                    AccessKey="<%$Resources:wss,navigation_accesskey%>"  
                    UseSimpleRendering="false"      …

StaticSelectedStyle-ItemSpacing="0px"
StaticMenuItemStyle-ItemSpacing="0px"
StaticSubMenuIndent = "0px"

After that, you should get something like this screen

image

Thursday, August 26, 2010

[Tutorial] Hide "Site Actions" for the anonymous users (SPSecurityTrimmedControl)

It uses to hide the SiteActions button based on the permission set. I tried it with hide html table for that control, it’s work to me ! So no problem SiteAction is inside a styled table.

<SharePoint:SPSecurityTrimmedControl ID = "spstcSiteActions" runat = "server" PermissionsString = "ManageWeb" >

……………

</SharePoint:SPSecurityTrimmedControl>


List Permissions

ManageLists
CancelCheckout
AddListItems
EditListItems
DeleteListItems
ViewListItems
ApproveItems
OpenItems
ViewVersions
DeleteVersions
CreateAlerts
ViewFormPages

Site Permissions

ManagePermissions
ViewUsageData
ManageSubwebs
ManageWeb
AddAndCustomizePages
ApplyThemeAndBorder
ApplyStyleSheets
CreateGroups
BrowseDirectories
CreateSSCSite
ViewPages
EnumeratePermissions
BrowseUserInfo
ManageAlerts
UseRemoteAPIs
UseClientIntegration
Open
EditMyUserInfo

Personal Permisions

ManagePersonalViews
AddDelPrivateWebParts
UpdatePersonalWebParts

reference : Hide "Site Actions" for the anonymous users (The easy way)