Uutiset:

Wondering if this will always be free?  See why free is better.

Main Menu
Advertisement:

Moving a button

Aloittaja Surf3rDud3, marraskuu 23, 2011, 10:09:25 AP

« edellinen - seuraava »

Surf3rDud3

I wonder if it was possible to move a button to the other side of a navigation bar? Instead of being on the left that one single button would be on the right while the rest would stay put... Look at the picture below... Thanks

Sir Osis of Liver

Ok, this is an awful hack (hope Antechinus doesn't see it), but it werks gud!

In index.template.php find this:



// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

echo '
<div id="main_menu">
<ul class="dropmenu" id="menu_nav">';

foreach ($context['menu_buttons'] as $act => $button)
{
echo '
<li id="button_', $act, '">
<a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
<span class="', isset($button['is_last']) ? 'last ' : '', 'firstlevel">', $button['title'], '</span>
</a>';
if (!empty($button['sub_buttons']))




Change it to this:



// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

echo '
<div id="main_menu">
<ul class="dropmenu" id="menu_nav">';

foreach ($context['menu_buttons'] as $act => $button)
{

/// echo ' button = ' . $act . '<br>';

if ($act == 'mlist')

echo '
<li id="button_', $act, '" style="float: right;">
<a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
<span class="', isset($button['is_last']) ? 'last ' : '', 'firstlevel">', $button['title'], '</span>
</a>';

else

echo '
<li id="button_', $act, '">
<a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
<span class="', isset($button['is_last']) ? 'last ' : '', 'firstlevel">', $button['title'], '</span>
</a>';
if (!empty($button['sub_buttons']))



Substitute the action of the button you want to move right in if($act == 'mlist').  If you don't know the action, use the triple-slashed line to echo the values.

When in Emor, do as the Snamors.
                              - D. Lister

ARG01

No, I will not offer free downloads to Premium DzinerStuido themes. Please stop asking.

Surf3rDud3

Is it illegal to do or something? Lol.

Surf3rDud3

Lol it works but.... it took out the look of the navigation... Look...

IF you need my original index.template its also below. :)

Matthew K.

Of course it's not, he just didn't want Antechinus to see it because of it's possibly hackish method.
Lainaus käyttäjältä: Surf3rDud3 - marraskuu 24, 2011, 11:04:08 AP
Is it illegal to do or something? Lol.

Sir Osis of Liver


This should do it.  I knocked that off in default theme between pizza & beer and folding my underwear.  Remember to substitute your action in if ($act == 'mlist').

Gotta run - the css police are after me.
When in Emor, do as the Snamors.
                              - D. Lister

Surf3rDud3

It just moves it to the last button and not to the other side... :/

Sir Osis of Liver

When in Emor, do as the Snamors.
                              - D. Lister

Surf3rDud3


Sir Osis of Liver


A favorite theme.  Took a quick look - it's in index.css.  Have to toddle off into the realworld, but I'll get to it later.

When in Emor, do as the Snamors.
                              - D. Lister

Sir Osis of Liver

Just don't tell anyone where you got this -



// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

echo '
<ul id="topnav" style="width: 99%;">';

foreach ($context['menu_buttons'] as $act => $button)
{

if ($act == 'mlist')

echo '
<li id="button_', $act, '" style="float: right; margin: 0 8px 0 0;">
<img src="Themes/MysticJade/images/custom/toolbar-div.png" style="float: left;">
<a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
<span class="', isset($button['is_last']) ? 'last ' : '', 'firstlevel">', $button['title'], '</span>
</a>';

else

echo '
<li id="button_', $act, '">
<a class="', $button['active_button'] ? 'active ' : '', '" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '><span>', $button['title'], '</span></a>';

When in Emor, do as the Snamors.
                              - D. Lister

ARG01

Lainaus käyttäjältä: Krash. - marraskuu 25, 2011, 01:55:00 IP

A favorite theme.  Took a quick look - it's in index.css.  Have to toddle off into the realworld, but I'll get to it later.



Don't you mean index.template.php?  ;)
No, I will not offer free downloads to Premium DzinerStuido themes. Please stop asking.

Sir Osis of Liver


If I did it the right way, it would be index.css.  Couldn't get the toolbar-divs where I wanted 'em, so I hacked it the old fashioned way.  Would be interesting to see someone do this with just css.


When in Emor, do as the Snamors.
                              - D. Lister

ARG01

Lainaus käyttäjältä: Krash. - marraskuu 25, 2011, 11:31:02 IP

If I did it the right way, it would be index.css.  Couldn't get the toolbar-divs where I wanted 'em, so I hacked it the old fashioned way.  Would be interesting to see someone do this with just css.

I don't think that it could be done purely with css. My opinion is that since the menu runs from Subs.php, a separate menu item to the right would need to also be coded in separately along with a separate addition in index.css for that specific menu item.
Too much code work for my knowledge.

;D

No, I will not offer free downloads to Premium DzinerStuido themes. Please stop asking.

Surf3rDud3

Whoa thanks so much... sorry this was a hassle all for just button... i did have a problem with the image source for the toolbar_div but i fixed... But once again thanks :)

Advertisement: