New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ElggMenuItem should support icon option (Trac #3547) #3547
Comments
cash wrote on 41447769-01-27 Just for everyone's reference, current solution is to pass all the icon/text as the text parameter. This ticket is mostly about encouraging a particular mark-up. This feels extremely low on the priority list or maybe I'm just not seeing the advantages to it. |
ewinslow wrote on 41449768-03-10 I have run into minor theming issues without that extra span (there's a reason jquery-ui does it this way, too). Another application that I have run into is customizing the icons of menu items. Would be nice to just do |
cash wrote on 41489621-05-16 Note to self: any solution would need to support RTL languages where the icon would appear to the right of the text. |
ewinslow wrote on 41500501-01-25 This does not need to go into 1.8, but it seems like we will want it at some point? BTW, this could also be useful for input buttons. I've seen something like the following markup, for example:
That allows you to stick icons "in" input buttons even though the value attribute can't accept html. |
ewinslow wrote on 42365365-02-08 Menu items are the main place this issue comes up. Maybe we should just add this to the ElggMenuItem class? |
Milestone changed to |
Title changed from |
ewinslow wrote on 42555253-11-30 Another approach:
CSS is then used to style anything with data-icon using the :before pseudo selector. I'm partial to this one because it's a lot cleaner in the API:
It also means we don't have to explicitly add more logic to our views, since it's all taken care of by css. |
ewinslow wrote on 42555355-02-05 As a bonus, the attribute-selector method works on all browsers all the way down to ie7! |
Milestone changed to |
We definitely don't care about ie7 anymore, but this still seems like it would be a sensible improvement. |
Fixed by #10451 |
Original ticket http://trac.elgg.org/ticket/3547 on 41439598-10-31 by ewinslow, assigned to unknown.
Elgg version: 1.8 Beta
produces something like:
Main motivation is more power when theming. E.g. could be helpful for menus if you just want to add/remove/modify the icon, not necessarily the whole text. Also allows more control over vertical-align issues when the text of the url as wrapped in a separate span, as opposed to
<span class="elgg-icon ..."></span>blah...
Not totally sure whether we should make 'icon' "magically" recognize the icon names, or whether we should just expect arbitrary html. I lean towards recognizing icon names.
The text was updated successfully, but these errors were encountered: