<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to embed an attribute value in a hyperlink within infoWindow/content/href in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-embed-an-attribute-value-in-a-hyperlink/m-p/344630#M31803</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The following sample in the developer help shows how to use attribute information in a hyperlink:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/fl_infowindow.html"&gt;http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/fl_infowindow.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Feb 2011 17:32:46 GMT</pubDate>
    <dc:creator>KellyHutchins</dc:creator>
    <dc:date>2011-02-10T17:32:46Z</dc:date>
    <item>
      <title>How to embed an attribute value in a hyperlink within infoWindow/content/href</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-embed-an-attribute-value-in-a-hyperlink/m-p/344629#M31802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am very new to ArcGIS API for JavaScript so bare with me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to use a value from an attribute such as a "name" to reference a text&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;file within the content of an infoWindow such as:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;lt;a href="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://foobar.com/name1/name1.txt" rel="nofollow" target="_blank"&gt;http://foobar.com/name1/name1.txt&lt;/A&gt;&lt;SPAN&gt;"&amp;gt; Name: " + attrs.Name + ".txt&amp;lt;/a&amp;gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;where &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;mainlink = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://foobar.com/" rel="nofollow" target="_blank"&gt;http://foobar.com/&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;end_of_link = attrs.Name + "/" + attrs.Name + ".txt"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;link = mainlink + end_of_link&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;and the variable "link" is substituted above for "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://foobar.com/name1/name1.txt" rel="nofollow" target="_blank"&gt;http://foobar.com/name1/name1.txt&lt;/A&gt;&lt;SPAN&gt;".&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone help me with the syntax in the above reference using the link variable?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 17:27:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-embed-an-attribute-value-in-a-hyperlink/m-p/344629#M31802</guid>
      <dc:creator>WendiYoung</dc:creator>
      <dc:date>2011-02-10T17:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed an attribute value in a hyperlink within infoWindow/content/href</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-embed-an-attribute-value-in-a-hyperlink/m-p/344630#M31803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The following sample in the developer help shows how to use attribute information in a hyperlink:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/fl_infowindow.html"&gt;http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/fl_infowindow.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 17:32:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-embed-an-attribute-value-in-a-hyperlink/m-p/344630#M31803</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2011-02-10T17:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed an attribute value in a hyperlink within infoWindow/content/href</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-embed-an-attribute-value-in-a-hyperlink/m-p/344631#M31804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am also struggling with this. The link to the sample seems to be broken, is there another sample that demonstrates this somewhere else?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2012 21:01:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-embed-an-attribute-value-in-a-hyperlink/m-p/344631#M31804</guid>
      <dc:creator>EmilyLaMunyon</dc:creator>
      <dc:date>2012-03-01T21:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed an attribute value in a hyperlink within infoWindow/content/href</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-embed-an-attribute-value-in-a-hyperlink/m-p/344632#M31805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To do this, you want to build an HTML string. If you want markup that looks like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;a href="http://www.server.com/path/file.txt"&amp;gt;link text&amp;lt;/a&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and you have an attributes object that looks like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
{ 
&amp;nbsp; "path": "some-web-server-folder",
&amp;nbsp; "file": "data"
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You would do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var anchor = "&amp;lt;a href='http://www.server.com/" + attr.path + "/" + app.file + ".txt'&amp;gt;link text&amp;lt;/a&amp;gt;";
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Managing those single and double quotes can get unwieldy. If you're building big strings, check out &lt;/SPAN&gt;&lt;A href="http://dojotoolkit.org/api/1.6/dojo/string/substitute" rel="nofollow noopener noreferrer" target="_blank"&gt;dojo.string.substitute&lt;/A&gt;&lt;SPAN&gt; to use templates which usually results in cleaner code.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:14:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-embed-an-attribute-value-in-a-hyperlink/m-p/344632#M31805</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2021-12-11T16:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed an attribute value in a hyperlink within infoWindow/content/href</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-embed-an-attribute-value-in-a-hyperlink/m-p/344633#M31806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks a million Derek.;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I have something like this working on infoWindows throughout my code, but for some reason it is not working on others. Is this syntax correct? When this is not working, the link does not substitute the fields correctly, it just keeps it literal. Is there more documentation on creating links using fields this way?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

map.infoWindow.setContent("&amp;lt;a href='http://surveyor.slco.org/gis/map/Corner_Reports/surveysimage.cfm?subdir=${subdir}&amp;amp;page_id=${page_id}.pdf'&amp;gt;PDF&amp;lt;/a&amp;gt;");
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:14:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-embed-an-attribute-value-in-a-hyperlink/m-p/344633#M31806</guid>
      <dc:creator>EmilyLaMunyon</dc:creator>
      <dc:date>2021-12-11T16:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed an attribute value in a hyperlink within infoWindow/content/href</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-embed-an-attribute-value-in-a-hyperlink/m-p/344634#M31807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;setContent requires a string, it doesn't do substitution for you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For more info, refer to our conceptual help. Specifically, the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp/intro_formatinfowindow.htm"&gt;format info window content section&lt;/A&gt;&lt;SPAN&gt;. Lots of other great info pertaining to popup/info window content in that area as well.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 02:05:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-embed-an-attribute-value-in-a-hyperlink/m-p/344634#M31807</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2012-03-02T02:05:13Z</dc:date>
    </item>
  </channel>
</rss>

