gantry5
gantry5 copied to clipboard
Empty tag (<span class="g-social-text"></span>) is generated, even if the social icon text is empty
What particle? Possibly missing conditional statement in twig
@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 %}
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!
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
Hi @man-of-earth-one. Have you made any progress on this issue or is it resolved?