XF 2.1 create widget with social icon

Luca.M

Member
salche can someone help me create simple social icons with respective links?
I need telegram facebook and youtube
thank you
 
You could just create a simple HTML widget using the share button HTML with a slight modification:

Code:
<div class="shareButtons shareButtons--iconic">
<div class="shareButtons-buttons">
    <a class="shareButtons-button shareButtons-button--brand shareButtons-button--facebook" href="FACEBOOKURL">
        <i aria-hidden="true"></i>
        <span>Facebook</span>
    </a>
    <a class="shareButtons-button shareButtons-button--brand shareButtons-button--twitter" href="TWITTERURL">
        <i aria-hidden="true"></i>
        <span>Twitter</span>
    </a>
    <a class="shareButtons-button shareButtons-button--brand shareButtons-button--reddit" href="REDDITURL">
        <i aria-hidden="true"></i>
        <span>Reddit</span>
    </a>
    <a class="shareButtons-button shareButtons-button--brand shareButtons-button--pinterest" href="PINTERESTURL">
        <i aria-hidden="true"></i>
        <span>Pinterest</span>
    </a>
    <a class="shareButtons-button shareButtons-button--brand shareButtons-button--tumblr" href="TUMBLRURL">
        <i aria-hidden="true"></i>
        <span>Tumblr</span>
    </a>
</div>
</div>

Result:
Screenshot_3.webp
 
Oh, I glossed over that this is for custom links rather than sharing.

You could probably add an Instagram button like this:
HTML:
<a class="shareButtons-button shareButtons-button--brand" href="...">
    <xf:fa icon="fab fa-instagram" />
    <span>Instagram</span>
</a>

...but you'd have to add custom styling for the hover effect.
 
Oh, I glossed over that this is for custom links rather than sharing.

You could probably add an Instagram button like this:
HTML:
<a class="shareButtons-button shareButtons-button--brand" href="...">
    <xf:fa icon="fab fa-instagram" />
    <span>Instagram</span>
</a>

...but you'd have to add custom styling for the hover effect.
Anyone know how to add the custom styling for the hover effect?
 
Just some standard LESS. Add a class to your link, like shareButtons-button--instagram. Then in your extra.less template, add something like:

Less:
.shareButtons-button--instagram:hover
{
    background-color: rgb(245, 0, 0);
}
 
Back
Top Bottom