Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: Night09 on November 30, 2014, 06:05:26 PM

Title: Icon locations
Post by: Night09 on November 30, 2014, 06:05:26 PM
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. ;)
Title: Re: Icon locations
Post by: Antes on November 30, 2014, 06:18:41 PM
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;
}
Title: Re: Icon locations
Post by: Night09 on November 30, 2014, 06:31:55 PM
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. :)
Title: Re: Icon locations
Post by: 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
Title: Re: Icon locations
Post by: Night09 on November 30, 2014, 07:09:02 PM
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.
Title: Re: Icon locations
Post by: Kindred on November 30, 2014, 07:20:44 PM
I would suggest adding separate icons for mods.
Title: Re: Icon locations
Post by: Antes on November 30, 2014, 07:32:42 PM
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.
Title: Re: Icon locations
Post by: Night09 on November 30, 2014, 07:37:38 PM
 I was thinking seperate ones too but just wanted to be sure. ;)
Title: Re: Icon locations
Post by: Night09 on December 01, 2014, 07:51:19 PM
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.
Title: Re: Icon locations
Post by: 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.
Title: Re: Icon locations
Post by: Night09 on December 01, 2014, 08:48:04 PM
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. ;)