Select to view content in your preferred language

Popups with multiple hyperlinks

2528
4
09-13-2011 06:31 AM
AshleyPeters
Frequent Contributor
I'm relatively new to Flex Viewer and I'm having a problem when I manipulate the compiled code for the Popups. I'd like to have multiple hyperlinks available. Here's my code:

<configuration>
    <title>{Name}</title>
    <description>
        <![CDATA[The <b>{NameLookup}</b> (FW Acquisition #{AcqNum}) was acquired on {Date}. The tract is located in {County} and consists of {PDFAcres} acres. <br><br><br>More tract info: <a href="{TractInfoL}" target='_blank'><font><font color="0xFFFFFF">Click Here</font></a><br><br>Hunting Regulations: <a href="{HuntingReg}" target='_blank'><font><font color="0xFFFFFF">Click Here</font></a><br><br>Info on adjacent State Park or WMA: <a href="{PartOfLink}" target='_blank'><font><font color="0xFFFFFF">Click Here</font></a><br><br>]]>
    </description>
    <fields>
<field name="Name"/>
        <field name="NameLookup"/>
        <field name="AcqNum"/>
        <field name="Date"/>
        <field name="County"/>
        <field name="PDFAcres"/>
        <field name="TractInfoL"/>
        <field name="HuntingReg"/>
        <field name="PartOfLink"/>
    </fields>
<linkfield>TractInfoL</linkfield>
<linkfield>HuntingReg</linkfield>
<linkfield>PartOfLink</linkfield>
</configuration>

Everything seems to be working okay, but my links are not cutting off where they should. Instead of just 'click here' being the link, it follows through until the next <a href>. Any suggestions on how to solve this problem?

Thanks in advance!
Tags (2)
0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Ashley,

   If you are going to manually insert the html hyperlinks your self as you are doing then there is no need to list the linkfield in the xml as well.

<configuration>
    <title>{Name}</title>
    <description>
        <![CDATA[The <b>{NameLookup}</b> (FW Acquisition  #{AcqNum}) was acquired on {Date}. The tract is located in {County} and  consists of {PDFAcres} acres. <br><br><br>More tract  info: <a href="{TractInfoL}" target='_blank'><font><font  color="0xFFFFFF">Click  Here</font></a><br><br>Hunting Regulations:  <a href="{HuntingReg}" target='_blank'><font><font  color="0xFFFFFF">Click  Here</font></a><br><br>Info on adjacent State  Park or WMA: <a href="{PartOfLink}"  target='_blank'><font><font color="0xFFFFFF">Click  Here</font></a><br><br>]]>
    </description>
    <fields>
 <field name="Name"/>
        <field name="NameLookup"/>
        <field name="AcqNum"/>
        <field name="Date"/>
        <field name="County"/>
        <field name="PDFAcres"/>
        <field name="TractInfoL"/>
        <field name="HuntingReg"/>
        <field name="PartOfLink"/>
    </fields>
</configuration>
0 Kudos
AshleyPeters
Frequent Contributor
Robert,

I removed the linkfields and that did not solve the problem.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ashley,

   OK, I think I see your syntax issue:

<configuration>
    <title>{Name}</title>
    <description>
        <![CDATA[The <b>{NameLookup}</b> (FW Acquisition  #{AcqNum}) was acquired on {Date}. The tract is located in {County} and  consists of {PDFAcres} acres. <br><br><br>More tract  info: <a href="{TractInfoL}" target='_blank'><font  color="0xFFFFFF">Click  Here</font></a><br><br>Hunting Regulations:  <a href="{HuntingReg}" target='_blank'><font  color="0xFFFFFF">Click  Here</font></a><br><br>Info on adjacent State  Park or WMA: <a href="{PartOfLink}"  target='_blank'><font color="0xFFFFFF">Click  Here</font></a><br><br>]]>
    </description>
    <fields>
    <field name="Name"/>
        <field name="NameLookup"/>
        <field name="AcqNum"/>
        <field name="Date"/>
        <field name="County"/>
        <field name="PDFAcres"/>
        <field name="TractInfoL"/>
        <field name="HuntingReg"/>
        <field name="PartOfLink"/>
    </fields>
</configuration>
0 Kudos
AshleyPeters
Frequent Contributor
Thanks Robert! That solved the problem.

On a similar note, not all of the cells in the link columns are filled in in the MXD.  For example, hunting is not allowed on Coldwater Mtn in Calhoun County so that link doesn't need to show for that property.

Is there a way to show only the links that are applicable to a given property?
0 Kudos