/SharePoint-code-snippets

Some reusable code for making SharePoint online nicer.

Primary LanguageJavaScript

SharePoint task progress bar

A simple progress bar for displaying task progress in SharePoint Online task lists.

Instructions:

  • in your task list, create a new "calculated" column;
  • the data type returned must be "number";
  • paste one of the codes from the source file here in the formula field of the newly created calculated column;
  • please mind the equal sign and quotes.

What you get:

progress_bar

CSS buttons

Instructions:

  • create a new code snippet
  • paste the code in the code snippet container.

What you get:

html_button

Native buttons

Instructions:

  • create a new code snippet and insert it into a page;
  • paste the code in the code snippet container.

What you get:

html_button

SharePoint conditional form fields

Instructions:

  • Write your script with the required conditional logic. It must always add its event listener and form associations; Check the sample here.
  • Upload your script to Site Assets in SP;
  • Register a new custom action by running this script in the browser console. (check the comments inside first and edit accordingly);
  • Enjoy.

SharePoint site homepage

Instructions:

  • the code here should work copy-paste style on any generic SP online team site (classic style) homepage.
  • It will hide the side navigation and ribbon and center the main content area.
  • From then on you could insert a table and make sectios with pictures for users to go to.

What you get:

homepage