My Government Services: Create Hyperlink in Info-Popup window

6003
7
10-23-2013 09:22 AM
Labels (1)
JordanRogers
New Contributor III
Hello,

I am currently working on setting up the My Government Services application for my organization. I would like to customize the 'info-Popup' window to include a hyperlink from the AGENCYURL field in the GovServiceInfo table. I currently have the Urls from this field displaying in the pop up window but they are not a clickable link. Has anyone else achieved this or does anyone know what I should change to have this field display as a hyperlink?

Thanks in advance,
Jordan

// ------------------------------------------------------------------------------------------------------------------------
// INFO-POPUP SETTINGS
// ------------------------------------------------------------------------------------------------------------------------
// Info-popup is a popup dialog that gets displayed on selecting a feature

//Field for Displaying the features as info window header.
InfoWindowHeader: "FacilitySitePoint.NAME",

// Set the content to be displayed on the info-Popup. Define labels, field values, field types and field formats.
InfoPopupFieldsCollection:
[
{
DisplayText: "Name:",
FieldName: "FacilitySitePoint.NAME"
},
{
DisplayText: "Address:",
FieldName: "FacilitySitePoint.FULLADDR"
},
{
DisplayText: "Contact:",
FieldName: "GovServiceInfo.CONTACT"
},
{
DisplayText: "Phone:",
FieldName: "GovServiceInfo.PHONE"
},
{
DisplayText: "Email:",
FieldName: "GovServiceInfo.EMAIL"
},
{
DisplayText: "Days Open:",
FieldName: "GovServiceInfo.OPERDAYS"
},
{
DisplayText: "Hours of Operation:",
FieldName: "GovServiceInfo.OPERHOURS"
},
  {
DisplayText: "Website:",
FieldName: "GovServiceInfo.AGENCYURL"
}
],
[ATTACH=CONFIG]28545[/ATTACH]
0 Kudos
7 Replies
MaryAnnSteinmetz
New Contributor III
I have the same issue. Did you ever get this figured out?
0 Kudos
AllisonMuise
New Contributor III
Hi Jordan & MaryAnn,

I've played around with this app and cannot find a way to make the URLs live in the popups for point features. Even when the link is live in ArcMap, this does not seem to translate over to the app's popups. I've submitted an enhancement request as an issue in the app's github repository to add this functionality in a future release of the app.

-Allison
0 Kudos
MikeTschudi
Occasional Contributor
If it is possible to modify the AGENCYURL field of GovServiceInfo, you could have it include the HTML for a link.

For example, if my field value is
<a href='http://www.naperville.il.us/recyclecenter.aspx' target='_blank'>Recycling Center</a>

then I will get
[ATTACH=CONFIG]34780[/ATTACH]
and clicking on the link will cause a new window to open with the website. One could also use a 'mailto:...' URL.

If you prefer to have the link replace My Government Services in the same browser window, just remove the "target" attribute:
<a href='http://www.naperville.il.us/recyclecenter.aspx'>Recycling Center</a>
0 Kudos
GrantHopkins
New Contributor III

Mike, thank you for sharing that with us. I tried your work around and it works.

It is a bit cumbersome to add in all that text and formatting with each record so hopefully this can be fixed by someone at Esri!

Grant

0 Kudos
JordanRogers
New Contributor III

Thanks for all the input! I just wanted to point out that the Canadian My Government Services Application does include a hyperlink option for a website as well as email in the pop up: http://www.arcgis.com/home/item.html?id=b03c14cb96d44608a245b7d6dc84256a

Perhaps some of this functionality could be pushed to the US application in the next version?

0 Kudos
CharmaleeSandanayake
New Contributor III

I was able to get the link to work using this field structure (where my field, 'Streetview' has the link I want to use) I am using a Canadian app so I don't know if it this is different in the US version:

                  {

                        DisplayText: "Street View:",

                        FieldName: "<a href='${Streetview}'target='_blank'>View in Street View</a>"

                    }

0 Kudos
KyleCrawford2
New Contributor III

Mike,

I have used your input to allow links to work in the pop ups and thanks for that! Further more does anyone know how to change the 'Link' in the pop up to a different color. For aesthetic proposes the dark blue isn't very appealing with a dark background.

Thanks,

Kyle

0 Kudos