Overview | |
FirstPoint SharePoint Development Documentation | This document is an overview of the practices which developers should follow when developing components for SharePoint. |
Documentation Tools | This documentation is generated using NaturalDoc. |
This document is an overview of the practices which developers should follow when developing components for SharePoint. It documents the standard markup, controls (where available), CSS, and JavaScript development team members should use when working with components which will be installed into SharePoint.
This documentation is generated using NaturalDoc.
You can find out more about usage by visiting the documentation site at: http://www.naturaldocs.org/documenting.html
Here is an example of a section of CSS
body { font-family: 'Trebuchet MS' !important; } /*--- the header title (h1) ---*/ #MainTopic .CTitle { font-size: 18px; background: #000; } /*--- the section titles (h2) ---*/ h2.CTitle { font-size: 16px !important; padding-top: 5px !important; padding-bottom: 5px !important; background: #62788D !important; }
Here is an example of C#
/// <summary> /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering. /// </summary> protected override void CreateChildControls() { // Add the controls. Control control = Page.LoadControl(WebControlPath); Controls.Add(new LiteralControl(string.Format("<div id=\"{0}\">", WrapperDivId))); Controls.Add(control); Controls.Add(new LiteralControl("</div>")); OnWebPartControlAvailable(control); base.CreateChildControls(); }
Here is an example of JavaScript
CreateSearchMappingSelect: function(collection) { var select = document.body.insertBefore(document.createElement("select"), document.body.lastChild); if(collection) { for(i = 0; i < collection.length; i++) { var option = select.insertBefore(document.createElement("option"), null); option.value = collection[i].SearchFieldName; option.innerHTML = collection[i].DisplayName; } } Element.hide(select); return select; },
Here is an example of SQL
CREATE TABLE SearchMapping( Id int PRIMARY KEY IDENTITY(1,1) NOT NULL, SearchFieldName nvarchar(100) NOT NULL, ContentTypeId nvarchar(100) DEFAULT '' NOT NULL, StaticFieldName nvarchar(100) DEFAULT '' NOT NULL, DisplayName nvarchar(100) DEFAULT '' NOT NULL, FieldScope nvarchar(25) NOT NULL ) GO
Here is an example of HTML
<div class="fp-panel-header clear"> <div class="fp-panel-header-left emboss"><span id="fp-mt-header">» Tasks<span>» Tasks</span></span></div> <div class="fp-panel-header-right"> <div id="fp-mt-current-filter-label"></div> <a href="/_layouts/FirstPointMyTasks/Default.aspx" class="button emboss" id="fp-mt-layout" title="Click to switch to full page view."><img src="/_layouts/FirstPoint/_gfx/icon-arrow-out.png" /><span>Full View<span>Full View</span></span></a> <a href='javascript:void(0);' class='button emboss' id='fp-mt-refresh'><img src='/_layouts/FirstPoint/_gfx/icon-refresh.gif' /><span>Refresh<span>Refresh</span></span></a> <a href='javascript:void(0);' class='button emboss' id='fp-mt-set-filters'><img src='/_layouts/FirstPoint/_gfx/icon-accept.png' /><span>Set<span>Set</span></span></a> </div> </div>