gantry5 icon indicating copy to clipboard operation
gantry5 copied to clipboard

Empty tag (<span class="g-social-text"></span>) is generated, even if the social icon text is empty

Open man-of-earth-one opened this issue 1 year ago • 5 comments

man-of-earth-one avatar Nov 30 '23 21:11 man-of-earth-one

What particle? Possibly missing conditional statement in twig

pablop76 avatar Dec 02 '23 08:12 pablop76

@man-of-earth-one, why don't you explain on what platform and what theme it is happening? Still, you can look for the 'social.html.twig' particle in your theme. If you look at your code, you can see that the social particle has a statement that checks whether you have selected icon only, text only, or both. If you select text only or both, the extension label is displayed.

Line 16:

{% if particle.display in ['both', 'text_only'] %}<span class="g-social-text">{{ item.text|e }}</span>{% endif %}

pmoreno-rodriguez avatar Dec 11 '23 17:12 pmoreno-rodriguez

Joomla 4, Gantry 5, php 7.4, Helium template. It could use a supplemental condition: and text not empty, in order to display it.

Keep up the good work!

man-of-earth-one avatar Dec 11 '23 20:12 man-of-earth-one

particle.display is a radio type control (type: input.radios), which means that you can only select one of the three options offered (text, icon or both), so it is not checked if the field text is empty, but if it is selected. I think the particle code is correct. Obviously if you select text or both and do not enter any text, the span tag will appear with the class g-social-text

pmoreno-rodriguez avatar Dec 12 '23 09:12 pmoreno-rodriguez

Hi @man-of-earth-one. Have you made any progress on this issue or is it resolved?

pmoreno-rodriguez avatar Mar 06 '24 15:03 pmoreno-rodriguez