News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

where do I change icon for a new link in navigation menu

Started by EmilioGaviria, February 24, 2025, 10:20:49 PM

Previous topic - Next topic

EmilioGaviria

I have a link for a cusom page called "download"

been at it for a bit and can't figure out how to change icon from "?"

is there something obvious that I am missing


Kindred

Default icons are defined by css... anything added by mod or manual will need to be defined in index.css -- either it's own image or one of the combined sprites
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

EmilioGaviria

is there an example?


I'm so confused by this

so in Sources/Subs.php I add

'Download' => array(
'title' => $txt['Downloads'],
'href' => $scripturl . '?action=downloads,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
),

where do I define what icon I want to use, what css etc

where is it done for home

'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
),

I don't see it here not in index.template.php


Sesquipedalian

Add an 'icon' element to your custom button's array, like so:

'Download' => array(
'title' => $txt['Downloads'],
'href' => $scripturl . '?action=downloads,
'show' => true,
'icon' => 'select_below',
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
),

In this example I have suggested the 'select_below' icon, which will use one of SMF's included icons that you might find to be an appropriate for a Downloads button. Another option among SMF's included icons that you might find appropriate is 'packages'.

If neither of those are suitable, you can also set the value of the 'icon' element to the name of a custom PNG file that you upload to ./Themes/default/images. For example, to use ./Themes/default/images/downloads.png, set the value of the 'icon' element to 'downloads.png'.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Kindred

I'd suggest changing that capital letter to lower case
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."


EmilioGaviria


Advertisement: