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

  • 357 views
Uploaded 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 …

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.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
357
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Clean, Compliant SharePoint Producing HTML Compliant Markup for Public Websites in SharePoint 2013 Tobias Lekman
  • 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. 10/12/2013 Tobias Lekman 3
  • 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. 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. 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. 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. 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. http://lek.mn/htmlfilter Tobias Lekman