SharePoint - List. Alternative text with hyperlink color before and after click

Copper Contributor

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 is invisible so on my page, I see only the alternative texts that act as menu items (Tell me if there is a better way)

 

I found the way using JSON to have my font size a bit bigger and have same color as regular links. However, these links don't change colors when used as would do a normal hyperlink.

 

Is it possible to have that ?

 

Thank you for your help

2 Replies

@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

ganeshsanap_0-1700996417411.png


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.

@ganeshsanap 

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 ?