Forum Discussion
Asuryan32
Nov 25, 2023Copper Contributor
SharePoint - List. Alternative text with hyperlink color before and after click
Hello. In my SharePoint page, I use a list as menu (So I can have a different menu, depends on which page I have. So, on this list, I have (for now) only two columns: Title and hyperlink. Title ...
ganeshsanap
Nov 26, 2023MVP
Asuryan32 Use JSON like this:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "a",
"txtContent": "@currentField.desc",
"attributes": {
"href": "@currentField",
"title": "@currentField.desc",
"target": "_blank"
},
"style": {
"text-decoration": "none",
"font-size": "16px"
}
}
Output:
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.
- Asuryan32Nov 26, 2023Copper Contributor
Hello.
Thank you for your answer. It's working well, except for the colors.
Is it possible to have the colors (Visited/not visited) automatically match the look form the pages ? For example, my site is set on "Orbit". Unvisited links are similar to light green and visited one like pink fuchsia)
If not, maybe it's possible to manually give the colors ?