Forum Discussion

Gilmour10's avatar
Gilmour10
Copper Contributor
Jun 30, 2022

Modern library item details/properties not accessible when embedded in page

Hi all,

 

I have a library embedded in a SPO site page. When right-clicking on an item, the pop up menu doesn't show a "Details" (or Properties) command...

If I go to the library app page instead, when right-clicking on an item, I see the Details command in the pop up menu.

Is this a standard behavior of library web parts when embedded in pages or is there a setting I need to change to have a full menu like the one belo

 

  • RobElliott's avatar
    RobElliott
    Silver Contributor

    Gilmour10 that's how the document library web part is designed, there isn't a setting to switch on the Details link.

     

    Rob
    Los Gallardos
    Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)

    • Gilmour10's avatar
      Gilmour10
      Copper Contributor

      RobElliott , thank you for clarifying. I’d be curious to know why this limitation. Need to ask: what I’m trying to achieve is for the web part in the page to be read only, but with full reading access to details. Can you suggest a workaround?

       

      Thank you again for responding 

      • RobElliott's avatar
        RobElliott
        Silver Contributor

        Gilmour10 I don't know why there is this difference, I don't work for Microsoft. But there is a solution to this using JSON view formatting.

         

        In your document library create a view and select Format current view from the views dropdown. In advanced mode delete what's already there and paste in the following JSON code:

         

         

         

        {
          "$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
          "hideSelection": true,
          "hideColumnHeader": true,
          "rowFormatter": {
            "elmType": "div",
            "style": {
              "flex": "0 0 170px",
              "display": "inline"
            },
            "children": [
              {
                "elmType": "button",
                "customRowAction": {
                  "action": "editProps"
                },
                "txtContent": "Edit Properties",
                 "style": {
                  "background-color": "#e3e7e7",
                  "width": "135px",
                  "height": "32px",
                  "margin": "10px 0"
                }
              },
              {
                "elmType": "button",
                "style": {
                  "border": "None",
                  "color": "#0077ff",
                  "background-color": "transparent",
                  "cursor": "pointer"
                },
                "txtContent": "[$FileLeafRef]",
                "customRowAction": {
                  "action": "defaultClick"
                }
              }
            ]
          }
        }

         

         

         

         

        Then add a document library web part to your page and point it to your new view. That will give you the link to the document and also a button that opens the properties pane for that document:

         

        Edit: for some reason the button in the web part doesn't seem to be clickable though it is from the library. I'll investigate.

         

        Rob
        Los Gallardos
        Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)

         

Resources