Giter Site home page Giter Site logo

haidarihammad / sp-hover-card Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mikevasiloff/sp-hover-card

0.0 1.0 0.0 37 KB

The default experience within the GCC High and DoD clouds for SharePoint Online does not show a hover card for users. This repo provides working JSON column formatting to add a useful hover card.

sp-hover-card's Introduction

SharePoint User Custom Hover Card

The default experience within the GCC High and DoD clouds for SharePoint Online does not show a hover card for users. This code repository provides working JSON column formatting to add a useful hover card.

Commercial Experience

What you see in the Commercial and GCC cloud environments when hovering over a user is something like this: Example of person card

US Federal Government Experience

What you see in the GCC High and DoD cloud environments is...

Well, no hover card at all. And that's what this repo is addressing.

Desired End Result

This is an example of what this solution provides:

Result of this solution

Solution Composition

This is a very simple solution using the column formatting feature of SharePoint which lets you "customize how fields in SharePoint lists and libraries are displayed". This is accomplished by constructing a JSON object that describes the elements and styles that are displayed when a field is shown in a view, and part of this includes the ability to create a custom hover card.

Unfortunately, there are some limitations with this feature. You are unable to:

  • Access the phone #, location/office, and most other user profile property values
  • Make the text in the hover card selectable/highlightable
  • Use URI schemes such as sip: or msteams: to add a "๐Ÿ’ฌ Chat" option
  • Use any JavaScript for custom functionality

Deployment

You have a few options for how you can apply this JSON formatting.

Option #1

You can apply it to the "Created By" and "Modified By" fields across an entire site collection by browsing to:

For the "Created By" Field

{YourSiteUrl}/_layouts/15/FldEditEx.aspx?field=Author

For the "Modified By" Field

{YourSiteUrl}/_layouts/15/FldEditEx.aspx?field=Editor

  1. Then scroll down to the Column Formatting section
  2. Paste in the JSON from the AuthorEditorField.json file
  3. Ensure Update all list columns is set to Yes, and then click OK

NOTE: You will not be able to use this approach on "NoScript" sites such as the backend SharePoint sites for a Team. You'll need to use Option #2 instead.

Option #2

  1. Open the list(s)/library(ies) you want it applied to
  2. Ensure the field (Created/Modified By) is shown in the view
  3. Click on the field's header title > Column settings > Format this column
  4. Click the Advanced mode at the bottom, and overwrite it with the JSON from the AuthorEditorField.json file
  5. Click the Save button

Other Person/Group Fields

There's a separate PersonGroupField file to handle the extra complexities that custom Person/Group fields can introduce, such as:

  • SharePoint Groups (shows a "View Members" button)
  • AD Security Groups
  • Office 365 Groups (shows the group's profile pic)
  • Multiple entries/selections (shows cards stacked on top of each other)

Caveats

Please be aware of the following items:

  1. When the person/group field allows multiple entries it does not provide values for Department or JobTitle
  2. Rendering Office 365 Group profile pics is handled via OWA and the file is already set with the DoD URL. To use within GCC High change PersonGroupField line 69 from https://webmail.apps.mil (DoD) to https://outlook.office365.us (GCC High)

sp-hover-card's People

Contributors

mikevasiloff avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.