JSON Formating doesn't work with content type

Alexis LOUIS 0 Reputation points
2024-05-22T08:58:29.91+00:00

Hello everyone,

I am currently working on a SharePoint EDM.

I have different types of content in a library (document, directory, set of documents).

I want to format the content type modification forms that I created using the JSON formatting tool (Configure layout).

This works correctly for lists but for my library it never registers. I looked for answers on the tech/net in English, I couldn't find anything on this subject.

I can open the JSON editing page by selecting a file then clicking on "Property" then doing "Configure Layout". However, my recordings never take place.

If anyone has any information on the subject, I'm all ears!

Thanks in advance

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,011 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Alexis LOUIS 0 Reputation points
    2024-05-23T06:00:56.8633333+00:00

    A. Create a document content type with managed metadata columns

    B. Insert the content type into a document library

    C. Create a document of the content type in question

    D. Return the document and make “Property”

    E. From the form -> Go to “Configure layout”

    F. Paste a JSON code in “Header”

    G. Save

    JSON code bellow

    {
        "elmType": "div",
        "attributes": {
            "class": "ms-borderColor-neutralTertiary"
        },
        "style": {
            "width": "99%",
            "border-top-width": "0px",
            "border-bottom-width": "1px",
            "border-left-width": "0px",
            "border-right-width": "0px",
            "border-style": "solid",
            "margin-bottom": "16px"
        },
        "children": [
            {
                "elmType": "div",
                "style": {
                    "display": "flex",
                    "box-sizing": "border-box",
                    "align-items": "center"
                },
                "children": [
                    {
                        "elmType": "div",
                        "attributes": {
                            "iconName": "EntitlementPolicy",
                            "class": "ms-fontSize-42 ms-fontWeight-regular ms-fontColor-themePrimary",
                            "title": "Details"
                        },
                        "style": {
                            "flex": "none",
                            "padding": "0px",
                            "padding-left": "0px",
                            "height": "36px"
                        }
                    }
                ]
            },
            {
                "elmType": "div",
                "attributes": {
                    "class": "ms-fontColor-neutralSecondary ms-fontWeight-bold ms-fontSize-24"
                },
                "style": {
                    "box-sizing": "border-box",
                    "width": "100%",
                    "text-align": "left",
                    "padding": "21px 12px",
                    "overflow": "hidden"
                },
                "children": [
                    {
                        "elmType": "div",
                        "txtContent": "Modification des propriétés du document"
                    }
                ]
            }
        ]
    }
    
    
    0 comments No comments

  2. Yanli Jiang - MSFT 22,656 Reputation points Microsoft Vendor
    2024-05-24T08:53:44.1466667+00:00

    Hi @Alexis LOUIS ,

    I followed your steps and the results are as follows:

    User's image

    From the results, it works well. If I understand it wrongly, please provide further information.

    If I understand it correctly, I suggest you try it on other sites to see the results. Or clear the browser cache or use private mode.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.