bjorn2404 / jQuery-Store-Locator-Plugin

A store locator plugin using Google Maps API version 3
MIT License
495 stars 235 forks source link

can i use HTML in XML ? #86

Closed JanSchmidhofer closed 8 years ago

JanSchmidhofer commented 8 years ago

I have a little problem. I want to show a list with icons in the location list. So ive added<ul><li></li></ul> in location-list-description.html. But if i add <ul> the plugin doesnt work. It doesnt show any locations. If i remove the <ul>, it works... crazy.

So i tried to work with <div> instead of a list. Not every location contains content with icons, so i created the xml file via php. It inserts <div class='iconclass'></div> to the xml file. Ive escaped out the "< >".

The XML contains this: icon1 = "&lt;div class='iconclass'&gt;&lt;/div&gt;"

The location-list-description.html contains this: {{icon1}}

but now i get

in the location list.

Is there any way to insert html into the xml file and show it as html in the frontend ?

JanSchmidhofer commented 8 years ago

i figured out another solution. if icon1 has a value in the xml file, i can show the html in the template file like this:

{{#if icon1}}<div class="iconclass"></div>{{/if}}