0

In the image I have two logos the same within one column but I would like to be able to change the image in the highlighted area so no two images are the same within the document library.

I would also like to have different color text on the header row.

JSON code I'm using:

{
"$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json";,
"elmType": "a",
"attributes": {
"href": "@currentField",
"target": "_blank"
},
"children": [
{
"elmType": "img",
"style": {
"width": "150px"
},
"attributes": {
"src": "https://nswgov.sharepoint.com/:i:/r/sites/SafeWorkAuthorisations/SiteAssets/images/Pyro-purple.png?csf=1&web=1&e=1Jr8Ur";
}
}
]
}

enter image description here

0

I assume you want to have a changing pic in the column. As you want to change the image in the highlighted area so no two images are the same within the document library.

Here is an example which may be useful to you: https://github.com/pnp/sp-dev-list-formatting/tree/master/column-samples/generic-socialpic

The main point is that you need to change the "src" to a dynamic URL to desired picture. It may needs some work to manage all the pics you want to display. Make them have sharing links of a certain pattern.

More examples of list formatting: https://github.com/pnp/sp-dev-list-formatting

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.