Showing posts with label Office 365. Show all posts
Showing posts with label Office 365. Show all posts


SharePoint vs. Teams vs. OneDrive

A few notes from a recent discussion about where to store files:

  • SharePoint Everywhere:
    • SharePoint is behind OneDrive, SharePoint and Teams. Each exposes a different level of functionality.
    • In Teams you can display as “Teams Files”, or click a link and open the backing SharePoint site. In OneDrive, most SharePoint functionality is hidden.
    • SharePoint sites can have multiple libraries (similar to multiple drive letters/network shares) while OneDrive and Teams only expose a single library.
  • Content Location and Ownership:
    • OneDrive is associated with individual users, and the content is “owned” by individuals. (OneDrive is actually SharePoint, but most of the SharePoint functionally is hidden.)
    • SharePoint libraries are associated with a SharePoint Site and the content is “owned” by the Site Owners, who are delegated to that role and can be quickly replaced in the future.
    • Teams file storage is in a disguised SharePoint library. It is “owned” by the Team owners.
  • Content Sharing:
    • OneDrive “sharing” is somewhat “ad hoc” and not driven by corporate policy or best practices. OneDrive users can share with anyone.
    • SharePoint “sharing” can be “ad hoc”, but is usually managed by assigning permissions to users, much like network shares. If done right, SharePoint allows quick and easy auditing of “who has what access to this file”.
    • Teams content by default is shared with the team.
  • Content Sync
    • The default use of OneDrive is via the “Sync” feature. Multiple users editing/deleting sync’d content impacts all users syncing that content.
    • The default use of SharePoint and Teams is closer to network shares. Files are stored there, and downloaded, or viewed/edited online, as needed. Libraries can be mapped to local drive letters. We typically discourage any SharePoint library syncing.

Governance is very important, especially with OneDrive. Some things to consider:
  • Who “owns” a file? Storing the file in OneDrive implies that the user owns it. Storing it in Teams or SharePoint implies the organization owns it. If in OneDrive, what’s the impact if a user leaves the company or the department? If in Teams, what’s the impact if a Team is deleted?
  • Who should grant access to corporate content? A OneDrive user can share with anyone. It’s so easy, the user rarely is thinking about security. In SharePoint or Teams, an “owner” grants and removes permissions for users and can easily update and audit user access.
  • Which copy of a document is the “single source of truth”? If we each have a copy in our OneDrive or local drive, which one is the official version?
  • If data with a legal impact is stored, who should manage it? Each user with their OneDrive, a “content steward” who manages a SharePoint site? A Teams owner (who has been property trained on your governance)?



Dynamic Images in SharePoint Document Sets

One of the cool features of Document Sets is that you can customize the "home page" of the Document Set by adding or editing its Content Type's home page web parts. The default page includes an image web part that can be customized with your choice of image. The only problem here is that the image is then used for all Document Sets created from this Content Type. Here's the default "home page" with the default image:


If you would like to change this image for each new Document Set added to a library, then upload a picture somewhere in SharePoint and then while viewing the new Document Set, click the Page ribbon, Edit Page and then edit the image web part. No fun if you have to do this for each new Document Set folder added to the library.

Make it Dynamic

What if you wanted the picture to be more automatic, or updateable by the users of the Document Set who might not have the permissions to edit the page?

Here's the plan:
  • Let the users of the Document Set upload a picture to the Document Set. We will pick a required named like "TeamLogo.png".
  • Modify the original Content Type in Site Settings, or modify the copy of that Content Type that is already associated with the library. (Content Types are copied to a library.)
    • Add a Content Editor Web Part just below the existing Image Web Part.
    • Add JavaScript to change the URL of the Image Web Part's HTML to point to our picture.

The steps below assume you have already created your custom Document Set Content Type.
  1. Go to Site Settings and Site Content Types and click the Content Type, or
    Go to the library, visit Library Setting and click the Content Type.
  2. Click Document Set Settings.
  3. Scroll down and click Customize the Welcome Page.
  4. In the ribbon click PAGE and Edit Page.
  5. Click below the Image web part (but still in Zone 1).
  6. Click the INSERT ribbon and click Web Part.
  7. In the Media and Content section click Content Editor and the click Add.
  8. If the web part did not go below the Image web part:
    1. In the Content Editor Web Part click the dropdown arrow and click Edit Web Part.
    2. Expand Layout, change the Zone Index from 0 to 1 and click Apply.
  9.  In the Content Editor Web Part click "Click here to add new content".
  10. Click the FORMAT TEXT ribbon and click Edit Source.
  11. Add the JavaScript from below.
  12. Replace "\\myimage.png" filename with something better like "\\teamlogo.pgn" or \\projectlogo.prg.
  13. Click OK and then APPLY. (no image will display while in the page editor)
  14. Click the PAGE ribbon and click Stop Editing.
  15. If you just created a new Content Type, go create a new library and add this Content Type to the library.
  16. In your library that is using this Content Type:
    1. Click the New button (above the list of files or in the ribbon) and create a new Content Type folder.
    2. Create a logo file and upload it to the Content Type folder. The image should be displayed in the Content Type home page area.


The JavaScript code.

  // get the page's URL
  var url = window.location.href;
  // make sure we are not in page edit mode
    // get the "RootFolder" query string parameter
    var rootpath = url.split("RootFolder=")[1].split("&")[0];
    // build a URL to our image file. Replace "myimage.png" with something
    // better like "\\teamlogo.pgn" or "\\projectlogo.prn"
    var imgpath = "..\\..\\.." + rootpath.replace(/%2F/g, "\\") + "\\myimage.png"; 
    // update the image source
    // Note that the ID is for the default doc set image web part. Yours
    // may be different!

Note to spammers!

Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.