News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Icon locations

Started by Night09, November 30, 2014, 06:05:26 PM

Previous topic - Next topic

Night09

Hi guys,

On 2.1 if you go to Admin > Configuration  menu list the Modification Settings icon is a green jigsaw piece. I figured its where the CSS says but on the HD sheet I cannot see that particular icon. Is it layered so cant simply be seen or am I looking at the wrong sheet?

I need to add an icon to the menu ive created but was going to see if it can be simply hooked into the existing array.

Thanks for any pointers. ;)

Antes

to add menu icon or hd (big) icon you simply need to define a css rule for your action

.generic_icons.your-action & .large_admin_menu_icon.your-action, but since most of the needed already handled by generic_icons & large_admin_menu_icon, you just need to give icons physical location. large_admin_menu_icon is only needed if you added your page to main admin page.

Example
.generic_icons.cat {
background: url(../images/icons/cat.png) no-repeat;
}
.large_admin_menu_icon.cat {
background: url(../images/icons/cat_hd.png) no-repeat;
}

Night09

Thanks Antes for the quick reply.

I am toying round adding a new subsection to the configuration menu which is working minus the icon. I did follow back to the CSS and the icons folder but when the green jigsaw couldnt be seen it made me think something was amiss.

Ill pop that into the CSS and edit to a new icon I need to display. :)

Kindred

Icons are all included as sprites in 2.1... Which means thatbthe puzzle icon is part of a larger image and is called by css positioning
Сл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."

Night09

Quote from: Kindred on November 30, 2014, 06:56:49 PM
Icons are all included as sprites in 2.1... Which means thatbthe puzzle icon is part of a larger image and is called by css positioning

Yeah ive come across them on some other PHP software I have worked on using pixel locations to select the desired sections. Should we add to the existing large image or just add seperate ones for mods? I am as said getting familiar with the menu and configuring the help,text and icons to show custom ones ready to add function once im sure what im doing.

Kindred

I would suggest adding separate icons for mods.
Сл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."

Antes

Agree, unless you want to use one of the default, I strongly suggest you to leave default sprites alone :P that may cause big issues if more than one author tries to change those icons.

Night09

 I was thinking seperate ones too but just wanted to be sure. ;)

Night09

Ok ive got adding menu items sorted an icons that match correctly when they appear on the menu and as the tiles on main. The only issue im having is I wanted to add icons to the submenu array options but when ive tried all im getting is letters in place of the icons. Is it simply down to the css edits to do this or the admin template as well? I cant see any examples in the existing as SMF only uses icons at top level from what I can see.

Antes

yes, sub sections not supporting icons. We can get around it with adding some stuff but I don't think its really good idea, and it'll create some inconsistency since we don't have plan to add icons to sub-sections.

Night09

Quote from: Antes on December 01, 2014, 08:34:57 PM
yes, sub sections not supporting icons. We can get around it with adding some stuff but I don't think its really good idea, and it'll create some inconsistency since we don't have plan to add icons to sub-sections.

Thanks for the heads up, I might have a play around and see how it turns out. ;)

Advertisement: