Forum Discussion

Anders_Poulsen_RG's avatar
Anders_Poulsen_RG
Copper Contributor
Jun 14, 2024

Document hyperlink from document properties

Do you have any ideas to create a Hyperlink from document properties in modern view as it is in classic view? See examples below

 

Modern mode:

Classic mode:

 

 

4 Replies

    • Anders_Poulsen_RG's avatar
      Anders_Poulsen_RG
      Copper Contributor

      NicolasKheirallah thank you very much

       

      I am able to create a link in the header but i can not get a dynamic href link to the current document. (see json below the picture)

       

      The current href returns: https://royalgreenland.sharepoint.com/sites/BusinessProcessModel/sites/Test%20af%20brugerdefineret%20visning/Forms/AllItems.aspx?ID=1

       

      And I want it to return:  

      https://royalgreenland.sharepoint.com/sites/BusinessProcessModel/Test%20af%20brugerdefineret%20visning/Forms/AllItems.aspx?id=%2Fsites%2FBusinessProcessModel%2FTest%20af%20brugerdefineret%20visning%2FProcess%20flow%20template%2Epdf&parent=%2Fsites%2FBusinessProcessModel%2FTest%20af%20brugerdefineret%20visning 

       

       

      {
      "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": "link",
      "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": "a",
      "txtContent": "Click here for details",
      "attributes": {
      "href": "= @currentWeb + '/sites/Test%20af%20brugerdefineret%20visning/Forms/AllItems.aspx?ID=' + [$ID] ",
      "target": "_blank"
      }
      }
      ]
      }
      ]
      }