Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: Mick. on December 24, 2021, 09:16:06 AM

Title: [Pro Tip]: Add Icons to Reply, Mark Unread, Recieve Alert, etc buttons
Post by: Mick. on December 24, 2021, 09:16:06 AM
(https://www.idesignsmf.com/images/replyicon.png)

2.1 has a gazillion icons everywhere but they forgot to add nifty icons to Post buttons. The other day I saw a website that had a "Plus" icon next to their Reply button. I thought it was nice so I decided to add my own.

In this case, it's very simple. If you already use FontAwesome...

Open index.english.php and find:
$txt['reply'] = 'Reply';
Let's add the icon with color. Replace with:
$txt['reply'] = '<span style="color: #fa5f66;"><i class="fas fa-plus"></i></span> Reply';
Change the hex color #fa5f66; to suit your theme and if you want, do the same to the other buttons.

replyicon.jpg
Title: Re: [Pro Tip]: Add Icons to Reply, Mark Unread, Recieve Alert, etc buttons
Post by: thomasc1989 on January 26, 2022, 06:21:36 PM
nice!
Title: Re: [Pro Tip]: Add Icons to Reply, Mark Unread, Recieve Alert, etc buttons
Post by: fingermask on February 14, 2022, 03:40:24 AM
This Post Is Old but Gold for me at this time!

Thanks, I found this.
Title: Re: [Pro Tip]: Add Icons to Reply, Mark Unread, Recieve Alert, etc buttons
Post by: Bigguy on February 15, 2022, 01:02:04 PM
Is there default icons in SMF 2.1.x for alerts, messages and profile. ?? I thought I saw some pop up when I was playin with the upgrade I did.
Title: Re: [Pro Tip]: Add Icons to Reply, Mark Unread, Recieve Alert, etc buttons
Post by: Sesquipedalian on February 15, 2022, 05:34:59 PM
Quote from: Bigguy on February 15, 2022, 01:02:04 PMIs there default icons in SMF 2.1.x for alerts, messages and profile. ?? I thought I saw some pop up when I was playin with the upgrade I did.
There are. You just need to use the main_icons CSS class plus the appropriate CSS class for the specific icon you want. For example, to get the default icon for alerts, use the following:

<span class="main_icons alerts"></span>
Title: Re: [Pro Tip]: Add Icons to Reply, Mark Unread, Recieve Alert, etc buttons
Post by: Bigguy on February 15, 2022, 05:36:33 PM
I may try that, thank you sir. :)
Title: Re: [Pro Tip]: Add Icons to Reply, Mark Unread, Recieve Alert, etc buttons
Post by: Bigguy on February 15, 2022, 07:55:46 PM
I had to play a bit but I got it to do what I wanted, thank you again.

Title: Re: [Pro Tip]: Add Icons to Reply, Mark Unread, Recieve Alert, etc buttons
Post by: Diego Andrés on February 15, 2022, 08:09:12 PM
Well those icons are already there by default  :P
You just have to comment or delete the lines that hide them in bigger screens

I think it's this?
Code (index.css) Select
#pm_menu_top .main_icons,
#alerts_menu_top .main_icons {
display: none;
}
Title: Re: [Pro Tip]: Add Icons to Reply, Mark Unread, Recieve Alert, etc buttons
Post by: Bigguy on February 15, 2022, 08:14:10 PM
Well, not sure if it's right but this is what I used. I also had to reposition the avatar as it was not inline with the other icons. I don't think the -1 in it is right, lol but hey it works:


#profile_menu_top > img.avatar {
 height: 18px;
 width: 18px;
 margin: -1px 5px 0 0;
 float: left;
}
#pm_menu_top .main_icons,
#alerts_menu_top .main_icons {
 display: inline-flex;
}
Title: Re: [Pro Tip]: Add Icons to Reply, Mark Unread, Recieve Alert, etc buttons
Post by: Bigguy on February 15, 2022, 08:19:33 PM
Quote from: Diego Andrés on February 15, 2022, 08:09:12 PMWell those icons are already there by default
That's all I wanted to use.