Clean, Compliant SharePoint
Producing HTML Compliant Markup for Public Websites in SharePoint 2013

Tobias Lekman
The Issue
• SharePoint uses script libraries and assets to support collaboration and content editing
capabilities
• Public...
10/12/2013

Tobias Lekman

3
Unnecessary Markup in SharePoint 2013
FILES MEASURED IN
KILOBYTES
JavaScript

CSS

CSS images

150
348

110

HTML

• 20 (!...
Unfiltered code is not compliant
• HTML markup is not valid
• Markup cannot be recognized by nonMicrosoft browsers
• Inval...
The Solution
• Page filters
• Light weight
• Developer full control

SharePoint page
publishing output

• Custom master pa...
Customizing the solution
• Edit master pages, place “filter comments”
around areas that should be hidden from
end users
• ...
Filtered output results
PERCENTAGE WEIGHT

Your Code
5%

SharePoint
95%

10/12/2013

• You can reduce the page weight by u...
http://lek.mn/htmlfilter

Tobias Lekman
Upcoming SlideShare
Loading in …5
×

Clean, Compliant SharePoint: Producing HTML Compliant Markup for Public Websites in SharePoint 2013

757 views

Published on

Public websites should be light-weight, HTML compliant and standards-based to ensure maximum browser and device support. Achieving this using SharePoint is not possible without some serious tweaking.

SharePoint adds a tonne (3.5mb and 480 inline rows of HTML) of JavaScript files, inline code, custom HTML tags and more into the pages. This is used to create the collaborative features and the editorial components, such as support for inline editing, webparts and ribbon menus. But when publishing public websites to anonymous visitors, we are not interested in including this stuff.

I have used many techniques in the past to accomplish this, for example control delegates and control adapters. I have written “catch all” HTML filter modules that recognizes and removes any SharePoint publishing scripts. The problem with all of these techniques is that they are heavy and difficult to maintain. This time, I chose a light-weight version.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
757
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Clean, Compliant SharePoint: Producing HTML Compliant Markup for Public Websites in SharePoint 2013

  1. 1. Clean, Compliant SharePoint Producing HTML Compliant Markup for Public Websites in SharePoint 2013 Tobias Lekman
  2. 2. The Issue • SharePoint uses script libraries and assets to support collaboration and content editing capabilities • Public websites has anonymous visitors • Anonymous users cannot, and should not, use collaboration and editing tools • SharePoint does not, by default, remove these functions for anonymous visitors 10/12/2013 Tobias Lekman 2
  3. 3. 10/12/2013 Tobias Lekman 3
  4. 4. Unnecessary Markup in SharePoint 2013 FILES MEASURED IN KILOBYTES JavaScript CSS CSS images 150 348 110 HTML • 20 (!) JavaScript files, total of 3.3 mb • 3 CSS files, total of 110 kb • 8 CSS images, total of 348 kb • ~600 lines of redundant rows of HTML 3300 10/12/2013 Tobias Lekman 4
  5. 5. Unfiltered code is not compliant • HTML markup is not valid • Markup cannot be recognized by nonMicrosoft browsers • Invalid markup leads to issues for screen readers and degrades compatibility for accessibility (WCAG) • Scripts cause performance degradation 10/12/2013 Tobias Lekman 5
  6. 6. The Solution • Page filters • Light weight • Developer full control SharePoint page publishing output • Custom master pages • Use public starter pages • Open source Page filter amends output using regular expressions • Available for download today • http://lek.mn/htmlfilter 10/12/2013 Filtered HTML is delivered in the server response to the end user Tobias Lekman 6
  7. 7. Customizing the solution • Edit master pages, place “filter comments” around areas that should be hidden from end users • Install the filter by referencing the control in the master page or within a control delegate • Add extended regular expressions to handle custom scenarios 10/12/2013 Tobias Lekman 7
  8. 8. Filtered output results PERCENTAGE WEIGHT Your Code 5% SharePoint 95% 10/12/2013 • You can reduce the page weight by up to 95% • You can completely control the output of the publishing page • You can create 100% compliant code • You can easier support accessibility requirements • You can maximize cross browser compatibility Tobias Lekman 8
  9. 9. http://lek.mn/htmlfilter Tobias Lekman

×