rendering social link attributes in an express custom tempalte
Permalink
How do I properly render social link attributes in an express custom template? I can get the social link object but the default output is just the url of the link. I'm assuming it is due to the attribute type just like rendering attributes containing images but it seems like there is no documentation for the social link attribute type?
Can someone point me in the right direction?
Can someone point me in the right direction?
I did similar, code below in case it's helpfull for anyone
<?php $exhibitor_socials = $entry->getExhibitor_socials(); $exhibitor_socials_arr = explode("\n", $exhibitor_socials); foreach($exhibitor_socials_arr as $social) { if (strpos($social, 'insta') !== false) { $socials .= '<a href="'.$social.'"><i class="fab fa-instagram"></i></a>'; } if (strpos($social, 'facebook') !== false) { $socials .= '<a href="'.$social.'"><i class="fab fa-facebook-f"></i></a>'; } if (strpos($social, 'twitter') !== false) { $socials .= '<a href="'.$social.'"><i class="fab fa-twitter"></i></a>'; } } ?>
Custom css and an image sprite are used to display the various social icons and a default for websites.