Navigation link icon

Started by Kwikasfuki, January 24, 2021, 07:29:27 AM

Previous topic - Next topic

Kwikasfuki

Currently using SMF 2.1RC3

I've followed this guide on creating a new navigation link in 2.1 which is working fine: https://simplemachines.org/community/index.php?topic=261880.0

However, I notice on 2.1 that the links have an icon next to them. How do set the icon?
I've tried adding 'icon' to the array and referencing the image URL, but can't get it to work.

At the moment my new link has the '?' icon next to it (see attachment)

Any help is appreciated.


Bugo

You can define any icon with CSS.


'your_button' => array(
'title' => 'Button title',
'href' => $scripturl,
        'icon' => 'your_icon',
'show' => true
),



global $settings;

addInlineCss('
.main_icons.your_icon::before {
background:url(' . $settings['default_images_url'] . '/your_image.png) no-repeat 0 0 !important;
}');

Kwikasfuki


Advertisement: