Interview Questions administrator

Best SharePoint administrator Interview Questions and Answers with topic wise:


Recycle Bin | MMS | ManagedVsCrawledProperties |
Showing posts with label Master Page. Show all posts
Showing posts with label Master Page. Show all posts

Friday, August 29, 2014

SharePoint interview Questions and anwers: Masterpage1

  • v4.master - This is default master page
  • Default. Master - this is used to support the 2007 user interface
  • Minimal. Master
  • Simple. Master- it is used for accessdenied.aspx, confirmation.aspx, error.aspx, login.aspx, reqacc.aspx, signout.aspx & webdeleted.aspx pages
V4.master:  Default master page for most non-publishing sites in SharePoint 2010. It is also the default system master page in both SharePoint Foundation and SharePoint Server.
Default.master: Helpful from upgrading MOSS 2007 sites to SharePoint 2010 sites.
Minimal.master: page is best suited for pages with minimal branding and navigation. The minimal.master is used with search pages and Office web applications.
Simple.master: Master page used for error and login pages. It lives in the fi le system and is not available in the master page gallery.
MWSDefaultv4.master: Found in the master page gallery of meeting workspace sites.
Nightandday.master: page contains controls specialized for publishing web content management.

V4.master: Default team site master page. Provides ribbon bar and other UI changes.
Characteristics:
  • Site actions are updated for 2010 and appear on left.
  • Ribbon bar is available
Default.master: Sites upgraded from SharePoint 2007 use this unless they are changed to use a v4 version.
Characteristics:
  • Site actions on right side and are same as SharePoint 2007 version
  • No ribbon bar
What is Page Layout?
Page layout dictates the overall look and feel of a web page. A page layout relies on a content type to determine the kind of content that can be stored on pages. Page layout contains field controls and web part.

Master pages and page layouts dictate the overall look and feel of your SharePoint site.
Differences are
Master pages contain controls that are shared across multiple page layouts, such as navigation, search, or language-preference for multilingual sites. Page layouts contain field controls and Web Parts
Page layouts can be used by all page instances that are based on that page layout. Master pages can be used by all page instances in a site.

Site navigation provides the primary interface for site users to move around on the sites and pages on the site. 


  1. Navigation controls on master pages
    1. Top link bar navigation
    2. Quick Launch navigation
    3. Breadcrumb navigation
    4. Tree view navigation
    5. Metadata navigation
  2. Navigation controls on page layouts
    1. Summary Links
    2. Table of Contents
    3. Content Query
  3. Navigation Web Parts
    1. Categories
    2. Site Aggregator
    3. Site in Category
    4. Tag Cloud
Ribbon Interface act as the UI enhancement in the product. It provides the commands to be executed in the form of Icons and tabs.

Select Empty Sharepoint template as a project template and select the module item for master page and css.
<Module Name="CustomMaster" Url="_catalogs/masterpage">  <File Path="CustomMaster\custommaster.master" Url="custommaster.master" Type="GhostableInLibrary" />
"Url="_catalogs/masterpage"" means this will be deployed to the master page library in SharePoint.
<Module Name="CustomCSS" Url="Style Library"><File Path="CustomCSS\DAVCSS.css"  Url="CustomCSS/yourfile.css"  Type="GhostableInLibrary" />
"Url="Style Library"" means this will be deployed to the style library in SharePoint.
Now add the following code in the feature receiver class file that contains above modules. Right click on the feature and click "Add Event Receiver"
public override void featureactivated(spfeaturereceiverproperties properties)
  {
      spsite currsite = (spsite)properties.feature.parent;
      spweb curweb = currsite.rootweb;
     uri masteruri = new uri(curweb.url + "/_catalogs/masterpage/custommaster.master");
     curweb.masterurl = masteruri.absolutepath;
     curweb.custommasterurl = masteruri.absolutepath;curweb.update();
   }
   This will apply the master page on activation of the feature.
  public override void featuredeactivating(spfeaturereceiverproperties properties)
  {
         spsite currsite = (spsite)properties.feature.parent;
        spweb curweb = currsite.rootweb;
       uri masteruri = new uri(curweb.url + "/_catalogs/masterpage/v4.master");
       curweb.masterurl = masteruri.absolutepath;
      curweb.custommasterurl = masteruri.absolutepath;
       curweb.update();
    }

3 steps involved to add the user control
Create and deploy user control
Register user control in the target
<%@ Register TagPrefix="MyUserControl"  TagName="UserName" Src="~/_controltemplates/MyUserControl/MyUserControl.ascx" %>
Insert the user control wherever required.
<MyUserControl:UserName id="MyUserControl1" runat="server" />
Note: For webpart (Page.LoadControl method)
Use SharePoint designer. Register the namespace of the web part class using <% Register directive. Then use the specified tag prefix from "Register" directive to add the instance of Web part class. Web parts outside the web part zones are referred as static web parts and behave as normal web control.
Register the custom css file as below .
<SharePoint:CssRegistration name="<% $SPUrl:~SiteCollection/Style Library/Custom/styles.css %>" After="corev4.css" runat="server"/>
In CSS, we can wirtie the style for attaching image
background:url(../images/mainBG.jpg)

With the help of delegate control, we can take any OOB control of SharePoint and replace with our custom control without any modification in the SharePoint page. So that new custom control overrides the existing one.
So the delegate control provide one of the option to add control (either server control or user control) on a SharePoint page
For example : In master page SearchBox control is included as  <SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox" />
This delegate control object uses features to locate the control which is specified in ControlId.
We can overwrite the above delegate control by presenting the below code in Element file of feature  <Control Id = "GlobalNavigation" Sequence="90"  ControlSrc="~/_ControlTemplates/ucGlobNavDelegateControl.ascx" />

AdditionalPageHead,  GlobalSiteLink(), GlobalSiteLink1, GlobalSiteLink2, SmallSearcgInputBox,
TopNavigationDataSource, PublicConsole, QuickLaunchDatasource
Searching through the main master page, Seattle.master, I’ve found these three new DelegateControls:
PromotedActions
SuiteBarBrandingDelegate
SuiteLinksDelegate
 
You can enable a Web Provisioned event receiver
using (SPWeb childSite = properties.Web)
 {   using (SPWeb topSite = childSite.Site.RootWeb)
  {    childSite.MasterUrl = topSite.MasterUrl;
       childSite.CustomMasterUrl = topSite.CustomMasterUrl;
      childSite.Update();
   }
 }
Using the SharePoint web interface or SharePoint Designer 2010
Using a master page
Using a page layout
Using a Content Editor Web Part
This has to be done in the site definition file system. I don't think there is an Interface for that, but it can be via SPD though.

List Attribute Id= 116

Changes in topnavigation control in  master page.
Ref: http://erikswenson.blogspot.in/2010/11/update-hide-first-tab-in-sp-2010.html

Master page and page layouts options missing in the left navigation in SharePoint designer2010
Users having site ownership privileges are able to view the site's Collection Administration pages but will not see the link enabling them to make the appropriate settings change.
Site collection administrators will enable the “Enable SharePoint Designer “(Site Actionsà SiteSettingsàselect SharePoint designer settings under site collection Administration category)

Conditionally renders the contents of the control to the current user only if the current user has permissions defined in the PermissionString.
<Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="XYZ">
</Sharepoint:SPSecurityTrimmedControl>

Tuesday, July 15, 2014

Minimal master page in SharePoint 2013:

Step1: Select “Design Manager” and click on “Edit Master pages

 
Step2: Select “Create a minimal master page” and enter the minimal master page name “SampleMinimal” and click on “Ok” button.

 Step3: Open the minimal master page through SharePoint designer 2013 and add the below lines of code in “SampleMinimal.html”
Reason: “Design Manager” Bug in SharePoint 2013:
The actual issue is users are unable to create list/library after applying the minimal master page.
But when we are trying to create a new Document-library or List using "add an app" link it always shows "loading...” as shown in image and never ends.
<div style="display: none;">
<!--SPM:<SharePoint:AjaxDelta id="DeltaPlaceHolderLeftNavBar" BlockElement="true" runat="server">-->
<!--SPM:<asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server">-->
<!--SPM:</asp:ContentPlaceHolder>-->
<!--SPM:</SharePoint:AjaxDelta>-->
<!--SPM:<SharePoint:AjaxDelta id="DeltaPlaceHolderPageTitleInTitleArea" runat="server">-->
<!--SPM:<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server">-->
<!--SPM:</asp:ContentPlaceHolder>-->
<!--SPM:</SharePoint:AjaxDelta>-->
</div>
 

Step4: Publish the major of version to the “SampleMinimal” minimal master page.
Step5: Set this minimal master page as default master to the site.

Please let me know if faced any issues.

Monday, October 15, 2012

SharePoint Interview Questions and Answers: MasterPage


  1. What is master page and use of it?
  2. Types of master pages in SharePoint?
  3. Is any improvements in SharePoint 2010 masterpage when compared to SharePoint 2007?
  4. Difference between asp.net master pages and SharePoint master pages?
  5. How to set our custom master page as default master page programmatically?
  6. How to configure user controls(.ascx) in master pages?
  7. How to add webparts to the master pages?
  8. Can I use .Net master pages into SharePoint directly?
  9. How to configure the images, css, style sheets in master pages?
  10. What is delegate control and use of it in SharePoint master pages?
  11. What are all types of delegate controls in master pages?
  12. What all are contentplaceholders in master pages?
  13. I have developed one custom master page and I want to set my custom master page as default master for every newly site collections, site, web etc.?
  14. Difference between SharePoint foundation master pages and SharePoint server master pages?
  15. How to set the custom master as default master to the site in both SharePoint foundation 2010 and SharePoint server2010?
  16. How to set the same masterpage to the child sites in both SharePoint foundation 2010 and SharePoint server2010?
  17. How to hide the “Home” tab(means first node on topNavBar) in master page 2010?
  18. Difference between deploying masterpage using farm solution and sandbox solution?
  19. Can we deploy published site master page into SharePoint foundation sites?
  20. Masterpage and page layouts options missing in the left navigation in SharePoint designer2010?
  21. Event receivers with custom application pages in SharePoint 2010?
  22. What’s the difference between MasterPageFile and DynamicMasterPageFile?
  23. What is the difference between deploying custom master pages either using sandbox and farm solution?   

Masterpage provides layouts for set of pages. Master Pages are a template that other pages can inherit from to keep consistent functionality. The pages that inherit from Master Pages are referred to as content pages.