Skip to main content
Topic: [ADDON] Ultimate Menu (Read 30398 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: [ADDON] Ultimate Menu

Reply #45

Great! I will give it another try!  :)

 

Re: [ADDON] Ultimate Menu

Reply #46

I get three errors:

1. A long title for the button (or maybe the html code inside the title) makes it impossible to edit the title after saving the button. This happens if you edit a button with such a long title (attachment 1). Title I saved was:

Code: [Select]
<i class="fa fa-pencil" aria-hidden="true"></i> Entwürfe

2. It causes problems with my start page using bootstrap things (attachment 2). The button clicked is not shown active too. This is line 26 and following:

Code: [Select]
	// Make damn sure we ALWAYS load last. Priority: 100!
if (end(explode(',', $modSettings['integrate_menu_buttons'])) != 'um_load_menu')
{
remove_integration_function('integrate_menu_buttons', 'um_load_menu');
add_integration_function('integrate_menu_buttons', 'um_load_menu');
}

3. Icons made with addon are not shown in mobile view. There is only a white pixel shown.

Re: [ADDON] Ultimate Menu

Reply #47

The errors can be fixed by changing:
Code: [Select]
if (end(explode(',', $modSettings['integrate_menu_buttons'])) != 'um_load_menu')
to:
Code: [Select]
$hooks = explode(',', $modSettings['integrate_menu_buttons']);
if (end($hooks) != 'um_load_menu')
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] Ultimate Menu

Reply #48

The error is gone, thank you, but the three problems stay.

Re: [ADDON] Ultimate Menu

Reply #49

Can the addon author please help me with the icons not shown in mobile view?  :-[

Edit: Would be nice if the user and group rights to see an menu icon or not were considered too.

Re: [ADDON] Ultimate Menu

Reply #50

Quote from: Jorin – 1. A long title for the button (or maybe the html code inside the title) makes it impossible to edit the title after saving the button. This happens if you edit a button with such a long title (attachment 1). Title I saved was:

Code: [Select]
<i class="fa fa-pencil" aria-hidden="true"></i> Entwürfe
This is not a problem of long name, but of unsanitized data.
@live627 you should htmlspecialchars $context['button_data']['name'].
Jorin, for the time being you can fix it by changing:
Code: [Select]
<input type="text" name="name" id="bnbox" value="', $context['button_data']['name'], '" tabindex="1" class="input_text" style="width: 100%;" />
to:
Code: [Select]
<input type="text" name="name" id="bnbox" value="', Util::htmlspecialchars($context['button_data']['name']), '" tabindex="1" class="input_text" style="width: 100%;" />
in ManageUltimateMenu.template.php (default theme directory).
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] Ultimate Menu

Reply #51

Quote from: Jorin – 2. The button clicked is not shown active too.
Make it active is not really a trivial thing.
The status is defined by the "action", without a new action it's basically very difficult to make a button active.
The only way that comes to my mind, is to let specify an action and a subaction on which it will be selected as active, though, even that is an incomplete solution because there may be situations it won't work.
No good answer here, sorry.
And this is more a problem with the way Elk highlights the button than the menu editor.

Quote from: Jorin – 3. Icons made with addon are not shown in mobile view. There is only a white pixel shown.
Something specific for that may be implemented in the menu editor, but at the moment, due to the way Elk handles icons in mobile view, you'd have to:
1) find the id of the button,
2) add a bit of css along the lines of:
Code: [Select]
#id_of_the_button .linklevel1:before {
font-family: 'FontAwesome';
    border: 3px solid #666;
    padding: 1px;
    margin: 2px;
    height: 1.15em;
    width: 1.15em;
    text-align: center;
    display: inline-block;
    border-radius: 4px;
    line-height: 1.2em;
    font-size: 2em;
    color: #666;
    content: 'the-code-of-the-fontawesome-icon-you-want';
}
For example, for your home page, it could be:
Code: [Select]
#button_f6f31cebde020d86add72bea0e662341-1468822676 .linklevel1:before {
font-family: 'FontAwesome';
    border: 3px solid #666;
    padding: 1px;
    margin: 2px;
    height: 1.15em;
    width: 1.15em;
    text-align: center;
    display: inline-block;
    border-radius: 4px;
    line-height: 1.2em;
    font-size: 2em;
    color: #666;
    content: '\f015';
}
while, for the Entwurfe button:
Code: [Select]
#button_6935862f74f620598b6b2549c202aafa-1468821375 .linklevel1:before {
font-family: 'FontAwesome';
    border: 3px solid #666;
    padding: 1px;
    margin: 2px;
    height: 1.15em;
    width: 1.15em;
    text-align: center;
    display: inline-block;
    border-radius: 4px;
    line-height: 1.2em;
    font-size: 2em;
    color: #666;
    content: '\f040';
}
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] Ultimate Menu

Reply #52

Or suppose I wanted to use an .SVG as a button, I could reference it using some slightly different code for the CSS block. (For example, referring to the foobar2000 subforum with the foobar2000 icon.)

Re: [ADDON] Ultimate Menu

Reply #53

I'm trying (unsuccessfully) to set a button with a .png or an .svg icon instead of a FontAwesome glyph. It's not even rendering the button if I set it as the background, and I can't seem to set content property to anything but raw text.

Re: [ADDON] Ultimate Menu

Reply #54

Can I see the code you added (I'm assuming CSS)?
LiveGallery - Simple gallery addon for ElkArte

Re: [ADDON] Ultimate Menu

Reply #55

I attempted to add:
Code: [Select]
    #button_2cad931b9566e54811554d5f7fdc1e84-1451402398 .linklevel1:before {
        padding: 1px;
        margin: 2px;
        height: 1.15em;
        width: 1.15em;
        display: inline-block;
        background: url(//fb2k_icon.png) no-repeat;
        background-size: 100%;
    }

It doesn't render the button at all unless I add a content: ' ', and in that case, it lacks the background image.

Attempting to use content: url(//fb2k_icon.png) results in a lovely question mark image appearing in Safari.

Re: [ADDON] Ultimate Menu

Reply #56

try
Code: [Select]
content: url(../../fb2k_icon.png)
LiveGallery - Simple gallery addon for ElkArte

Re: [ADDON] Ultimate Menu

Reply #57

I ended up settling on:

Code: [Select]
    #button_2cad931b9566e54811554d5f7fdc1e84-1451402398 .linklevel1:before {
        min-height: 40px;
        padding: 1px;
        padding-right: 41px;
        display: block;
        background-position: center;
        background-size: 40px 40px;
        background-repeat: no-repeat;
        background-image: url(../../fb2k_icon.png);
        content: "";
    }

Re: [ADDON] Ultimate Menu

Reply #58

rock on! ;D
LiveGallery - Simple gallery addon for ElkArte

Re: [ADDON] Ultimate Menu

Reply #59

Quote from: emanuele – Make it active is not really a trivial thing.
The status is defined by the "action", without a new action it's basically very difficult to make a button active.
The only way that comes to my mind, is to let specify an action and a subaction on which it will be selected as active, though, even that is an incomplete solution because there may be situations it won't work.
No good answer here, sorry.
And this is more a problem with the way Elk highlights the button than the menu editor.

Okay, maybe with future versions of ElkArte there is a way?

As for the rest, thank you very much. I uninstalled the addon and made the menu in Subs.php on my own so it has icons in mobile view.  ;)