Cartodb: Infowindows behaviour turns weird when you edit the HTML behind

Created on 24 Jan 2017  路  8Comments  路  Source: CartoDB/cartodb

Context

The default parsing/rendering behavior of the infowindows is overridden when user apply any change to the infowindow template using the HTML editor.

Steps to Reproduce

  1. Take any dataset with some string column
  2. Edit that string for an specific row and add HTML code to it, something like
<p><strong>The Puxa Gallery, in the district of Las Salesas, is a modern art gallery, offering a glimpse into its participation in international art fairs and its firm commitment to supporting emerging artists.</strong></p><p>At the helm of this space are Nuria Misert, former director of the Galer铆a Marlborough Madrid, and 脕ngel Antonio Rodr铆guez, journalist and art critic. Ardent defenders of freedom from indoctrination, in favour of permanent debate, they seek to disseminate the work of new artists whilst promoting their dialogue with emblematic authors from other generations.</p>
  1. In a different row, set that column to NULL
  2. Create a map from it
  3. Add an infowindow to the layer, and select at least the string column above
  4. Check the infowindows of both features
  5. Go to HTML editor for the infowindow, add an space at the end and apply the changes
  6. Check the infowindows of both features again

Current Result

(step 8)

  • The infowindow of the feature @ step 2 displays HTML tags in the linked field
  • The infowindow of the feature @ step 3 displays the column title and NULL or empty string value

Expected result

(step 6)

  • The infowindow of the feature @ step 2 displays plain text, the tags have been sanitized
  • The infowindow of the feature @ step 3 if the column value is null, the linked field is not displayed at all (not even the title)

Browser and version

Not relevant

.carto file

Not needed

Additional info

cc @piensaenpixel

Frontend bug stale

All 8 comments

Not sure if it is something already fixed or I missed any step in the path, but it is working fine IMHO, attaching GIF:

11340-issue

@noguerol, two things here:

  1. What @AbelVM mentioned was that the behavior with NULL values was different depending on the context (with current popup UI or with the "HTML editor"). So right now it is working properly now, at least the null values are displayed in both contexts, but we are in doubts if it is the best option. Should we display rows with null values within the infowindow?. IMHO, we should, because imagine if an infowindow only displays one column and that value is NULL, what should we display in the infowindow then? -> empty? 馃拑 .

  2. If you check the GIF above, there is a possibility to "sanitize" the row value in the HTML editor just using the triple {}, but that's something not specified anywhere. Should we add it at the end of the editor? like the one describing CMD + S.

  1. OK
  2. OK

Doing then the second point 馃拫 .

Morning!!

So, as far as I've understood (I'm a little espeso this morning):

  1. We keep the current behaviour
  2. We add a text explaining {{{ }}}

Is that right? In case it is, what should be the text?

I've been looking and I think we don't have any tips in the application with more than 1 line, so if the text is long we will have to change that template a little bit to allow multiple lines.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

F*CK U STALE BOT

:trollface:

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arianaescobar picture arianaescobar  路  4Comments

saleiva picture saleiva  路  4Comments

makella picture makella  路  3Comments

noguerol picture noguerol  路  5Comments

javitonino picture javitonino  路  5Comments