Forum Discussion
SP form header add Logo
- Feb 28, 2022
SG523 If you have stored the image in same site, you can use the relative URL of image like:
"src": "=@currentWeb + '/SiteAssets/MyImage.jpg'"OR copy the image URL as shown in below image & use it:
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
SG523 The following example should get you started. Insert the following code after line 16 in your JSON above.
{
"elmType": "div",
"style": {
"display": "flex",
"box-sizing": "border-box",
"align-items": "center"
},
"children": [
{
"elmType": "img",
"attributes": {
"src": "https://<tenant>.sharepoint.com/sites/lf/siteassets/logo.png",
"title": "Logo"
},
"style": {
"flex": "none",
"padding": "0px",
"padding-left": "10px",
"height": "80px",
"color": "white"
}
}
]
},
This just adds another div to the left of your existing header row and inserts an image. Change line 12 to reflect the full url to your image. Good luck!
Please click Mark as Best Response & Like if my post helped you to answer or resolve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- SG523Feb 28, 2022Brass Contributor
That is close but it still gives me a broken image instead of the logo. I got the logo from address right from the address bar while viewing the full image. I also tried sharing the image and using the link from sharing. Neither worked. How can I go about fixing this issue, I think it might be a permissions issue or something like that?
Thanks
- ganeshsanapFeb 28, 2022MVP
SG523 If you have stored the image in same site, you can use the relative URL of image like:
"src": "=@currentWeb + '/SiteAssets/MyImage.jpg'"OR copy the image URL as shown in below image & use it:
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- SG523Feb 28, 2022Brass ContributorThank you both so much! This has solved my problem. I used the second method of getting the path to make mine work!