Is it possible to have an image in Sitecore PowerShell Extensions GUI that has an embedded hyperlink to open a web page? For instance, if I had an image of a car in a PowerShell GUI form and when a user clicks the image, it would open https://cars.com.
2 Answers
It is possible to add a hyperlink to the dialog produced by Read-Variable
.
Example: The following example produces a dialog with a hyperlink.
$props = @{
"Parameters" = @(
@{ Name = "info"; Title = "Fancy Link"; Value = "<a href='https://www.google.com' target='_blank'>CLICK ME</a>"; Editor = "info" }
)
"Title" = "Sample Download Wizard"
"Icon" = "OfficeWhite/32x32/server_from_client.png"
"ShowHints" = $true
"OkButtonName" = "Next"
}
Read-Variable @props
-
What version of powershell are you running? When I try the Read-Variable, I get that it isn't a cmdlet or fuction.... I'm running powershell 7– ToddApr 5 at 15:19
Adding more to @Michael answer, So if you want to add image then you can add the path of your media library item like below.
$props = @{
"Parameters" = @(
@{ Name = "info"; Title = "Image With Link"; Value = "<a href='https://cars.com' target='_blank'><img src='/-/media/Default Website/sc_logo.jpg'></a>"; Editor = "info" }
)
"Title" = "Sample Download Wizard"
"Icon" = "OfficeWhite/32x32/server_from_client.png"
"ShowHints" = $true
"OkButtonName" = "Next"
}
Read-Variable @props
It will look like the below.
Hope it help.
-
ok I feel a bit silly. I think i'm posting in the wrong group. I don't use Sitecore....This is just straight powershell. Sorry for any inconvenience.– ToddApr 5 at 15:31
-