XF 1.4 Change text to icons

RichardKYA

Well-known member
Hello,

I'm trying to change the "watch forum" and "unwatch forum" text to icons in forum view.

I can remove the phrases from the "forum_view" template...


<xen:if is="{$canWatchForum}">
<a href="{xen:link 'forums/watch', $forum}" class="OverlayTrigger" data-cacheOverlay="false">{xen:if $forum.forum_is_watched, '{xen:phrase unwatch_forum}', '{xen:phrase watch_forum}'}</a>
</xen:if>


...and replace them with either <img> tags or <div>'s that have classes applied that link to my icons...


<xen:if is="{$canWatchForum}">
<a href="{xen:link 'forums/watch', $forum}" class="OverlayTrigger" data-cacheOverlay="false">
{xen:if $forum.forum_is_watched, '<div class="unwatch_forum concealed" title="Unwatch Forum"></div>',
'<div class="watch_forum concealed" title="Watch Forum"></div>'}</a>
</xen:if>


Either of these work fine, apart from, after the tab is clicked and the forum is either "watched" or "unwatched", the phrase reappears until the page is refreshed...

Before it's clicked...

Screen Shot 2015-03-17 at 14.57.03.webp

After it's clicked...

Screen Shot 2015-03-17 at 14.58.35.webp

After the page is refreshed...

Screen Shot 2015-03-17 at 14.59.21.webp

Obviously the phrases are stored somewhere else as well, but I don't know where and/or how they get applied if I have removed the phrase from the template.

Does anyone know where I need to remove these from?

Please and Thank you

:)
 
Hello,

You can see where I have changed the text to an icon by doing what I mentioned above, so to me, the edits are in the right place because the phrases are removed and the icons display fine. It's just what happens in between that doesn't make sense. (Well, to me anyway)

To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.
 
Last edited:
Top Bottom