0

When I click a link in the pop-up window the link opens a new tab to the same CARTO map instead of redirecting to the url specified.

Here is my code:

<div class="CDB-infowindow CDB-infowindow--light js-infowindow">
<div class="CDB-infowindow-close js-close"></div>
<div class="CDB-infowindow-container">
<div class="CDB-infowindow-bg">
  <div class="CDB-infowindow-inner js-inner">
    <ul class="CDB-infowindow-list js-content">
      <li class="CDB-infowindow-listItem">
          <h5 class="CDB-infowindow-title">Propery Map:</h5>
          <h4 class="CDB-infowindow-title"><a href="{{prop_map}}" target=" 
           {{prop_map}}">Link</h4>
      </li>
      <li class="CDB-infowindow-listItem">
          <h5 class="CDB-infowindow-title">Soils Map:</h5>
          <h4 class="CDB-infowindow-title"><a href="{{soils_map}}" target=" 
           {{soils_map}}">Link</h4>
      </li>
      <li class="CDB-infowindow-listItem">
          <h5 class="CDB-infowindow-title">FEMA Map:</h5>
          <h4 class="CDB-infowindow-title"><a href="{{fema_map}}" target=" 
           {{fema_map}}">Link</h4>
      </li>
      <li class="CDB-infowindow-listItem">
          <h5 class="CDB-infowindow-title">Stormwater Map:</h5>
          <h4 class="CDB-infowindow-title"><a href="{{swm_map}}" target=" 
            {{swm_map}}">Link</h4>
      </li>
      <li class="CDB-infowindow-listItem">
          <h5 class="CDB-infowindow-title">Sanitary Sewer Map:</h5>
          <h4 class="CDB-infowindow-title"><a href="{{san_map}}" target=" 
           {{san_map}}">Link</h4>
      </li>
      <li class="CDB-infowindow-listItem">
          <h5 class="CDB-infowindow-title">RPA Map:</h5>
          <h4 class="CDB-infowindow-title"><a href="{{rpa_map}}" target=" 
           {{rpa_map}}">Link</h4>
      </li>
      <li class="CDB-infowindow-listItem">
          <h5 class="CDB-infowindow-title">Contour/Topo Map:</h5>
          <h4 class="CDB-infowindow-title"><a href="{{contourmap}}" target=" 
           {{contourmap}}">Link</h4>
      </li>
      <li class="CDB-infowindow-listItem">
          <h5 class="CDB-infowindow-title">Zoning Map:</h5>
          <h4 class="CDB-infowindow-title"><a href="{{zoning_map}}" target=" 
          {{zoning_map}}">Link</h4>

     </li>
    </ul>
  </div>
</div>
<div class="CDB-hook">
  <div class="CDB-hook-inner"></div>
</div>

2

You would need to remove the target property or set it as `"_blank" if you want to open a new browser tag. This is a basic HTML, that you can use as an example:

    <div class="CDB-infowindow CDB-infowindow--light js-infowindow">
      <div class="CDB-infowindow-close js-close"></div>
      <div class="CDB-infowindow-container">
        <div class="CDB-infowindow-bg">
          <div class="CDB-infowindow-inner js-inner">
            <ul class="CDB-infowindow-list js-content">
              <li class="CDB-infowindow-listItem">
                  <h5 class="CDB-infowindow-subtitle">url</h5>
                <h4 class="CDB-infowindow-title"><a href="{{url}}" target="_blank">{{url}}</a></h4>
              </li>
            </ul>
          </div>
        </div>
        <div class="CDB-hook">
          <div class="CDB-hook-inner"></div>
        </div>
      </div>
</div>

link-popup

  • I tried this and it still won't follow the links. Any other ideas? – mnm247 Jun 27 '18 at 19:19
  • Can you send the .carto to support@carto.com? As soon as we find the solution, I will update my answer (I work at CARTO). – ramiroaznar Jun 28 '18 at 6:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.