3

I upload photos into my sharepoint online into assets folder, when I go to that folder navigator bar shows:

https://mybusiness.sharepoint.com/siteassets/Forms/AllItems.aspx?id=%2FSiteAssets%myFolder%2FIcons

So I want to use it into img src like:

<img src='~SiteAssets/Forms/AllItems.aspx?id=%2FSiteAssets%myFolder%2FIcons/IMAGE_1'>

But it don´t show photo... what is wrong with my src?

Mohamed El-Qassas MVP
  • 45,382
  • 9
  • 53
  • 96
Ledwing
  • 465
  • 4
  • 17

1 Answers1

5

It's not the correct image URL, try to Get the image URL as shown below

enter image description here

And the relative path should look like

~sitecollection/SiteAssets/Qassas.png

The image tag should look like (based on the Site Asset location)

<img src='../../SiteAssets/Qassas.png'/>

Or

<img src="/SiteAssets/Qassas.png">

[Update]

Based on my conversation with OP in chat, he tried to use HTML tag in a calculated column in SharePoint online. Unfortunately, it's blocked in 13/06/2017.

Some users have added HTML markup or script elements to calculated fields. This is an undocumented use of the feature, and we will begin blocking execution of custom markup in calculated fields in SharePoint Online from June 13, 2017 onwards. We are also providing this as a configurable option for on-premises in SharePoint Server 2016 and SharePoint Server 2013 via the June 2017 and subsequent Public Updates.

you can check the details at Handling HTML markup in SharePoint calculated fields

Another thread discuss this topic with some alternatives at June 13th 2017 Microsoft blocked handling HTML markup in SharePoint calculated fields - how to get the same functionality back

Mohamed El-Qassas MVP
  • 45,382
  • 9
  • 53
  • 96