Forum Discussion
Grayson1530
Feb 04, 2021Copper Contributor
Trying to Change the Gallery View with JSON to open custom URL instead of edit item menu
I have a simple list as follows: I'm trying to update the Gallery view so that when you click on the tile it opens the URL in "Form Link" instead of opening the standard "edit item" menu. I ...
- May 25, 2022If you remove the two lines of code for the customRowAction section, replace "button" with "a" and then add the following two lines of code below "role": "presentation", it should work. Just replace [@Place] with the name of your field that is the hyperlink.
"href": "[$Place]",
"target": "_blank"
MichelleN1790
May 25, 2022Copper Contributor
Grayson1530 I am also a JSON newbie. I don't know if this is the correct way but it worked for me. I removed the following lines from my gallery JSON. Now, only the text shows as an active link when hovering over or selecting it; not the whole tile. No more display form; only my custom link.
{
"elmType": "button",
"attributes": {
"class": "sp-card-defaultClickButton",
"role": "presentation"
},
"customRowAction": {
"action": "defaultClick"
}
},
- rgwinnMay 25, 2022Brass ContributorIf you remove the two lines of code for the customRowAction section, replace "button" with "a" and then add the following two lines of code below "role": "presentation", it should work. Just replace [@Place] with the name of your field that is the hyperlink.
"href": "[$Place]",
"target": "_blank"- MichelleN1790May 26, 2022Copper ContributorThat did the trick! Thank you much!
- ntompkinsNov 03, 2022MicrosoftThank you so so SO much! And to Grayson1530 for posting the question. This has been driving me CRAZY, and I just couldn't figure out how to do it! ❤️