Support Forum

Custom icons in mobile view

WE Wendell
Wendell
Member

hi again! just wondering if it’s possible to replace the add topic button (in forum view – mobile) with the custom icon of that forum in desktop view.

5 Answers

New Answer

IK Ike
Ike
Member

Hey Wendell,

OK Let’s see if I’ve understood what you want to do here!.. Should be pretty straight forward and I’m guessing you already have a child theme in place? If so, skip the next bit.

If not, make sure to download the Unified Child Theme Framework and checkout the Creating a Child Theme document for instructions on how to set things up.

First thing you will need to do is make sure your child theme has a copy of Unified’s spGroupView.php in the templates folder.

Please note that Unified has both mobile and desktop sections to it’s templates:

if($spDevice != ‘mobile’) = Desktop

if($spDevice == ‘mobile’) = Mobile

So, open your child themes spGroupView.php, navigate to line 45 (note this is inside a desktop section) and copy the entire function:

sp_GroupHeaderIcon('tagClass=spHeaderIcon spLeft');

Next navigate to line 91 (note this is inside a mobile section) and you should see the function:

sp_ForumIndexAddIcon('tagClass=spIcon spRight', __sp('Add new topic in this forum'));

You can either leave it in, comment it out with a hash (#) or completely remove it, but all you need to do is paste the entire sp_GroupHeaderIcon function into it’s slot or directly underneath it.

You may also need to change sp_GroupHeaderIcon’s spLeft to be spRight as it should then line up better with the other icons in the column.

Hope that helps, and hope I got it right!

WE Wendell
Wendell
Member

hi @ike 

i want the ‘forum’ icon to show, not the ‘group’ icon. anyway, i just replaced group with forum and it worked!

thanks so much! smile

IK Ike
Ike
Member

My mistake! I didn’t think I’d fully understood that but that’s my reading for you..

Simply replace:

sp_GroupHeaderIcon('tagClass=spHeaderIcon spRight');

With:

sp_ForumHeaderIcon('tagId=spSubForumHeaderIcon&tagClass=spHeaderIcon spLeft');

Again, same applies about changing the spLeft to spRight.

WE Wendell
Wendell
Member

my site and my forum is indeed looking great, on desktop and mobile view. (http://brgyginebra.ph)

even made the forum my home page, thanks to Simple-Press!

keep up the excellent work @ike @yellow-swordfish @mr-papa laugh

IK Ike
Ike
Member

I must say you’re forum ties into your site very well and looks fantastic! You’ve done a great job and I’m glad we’ve been able to help where requested, it’s great to see. And of course, thank you for the kind words!