News:

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

Main Menu

Custom Top Menu

Started by smp420, May 15, 2010, 12:57:45 PM

Previous topic - Next topic

mrmeeler


smp420

Quote from: cultureco on March 26, 2011, 02:38:51 AM
hello
Thank you for this usefull mod. It's working fine under 2.0 RC5 but i would like, same as this board here, the tab to be blue on the page we are (forum) and grey for other tabs just for à better look.
What do i have to change in css or index template ?
Thank you
Can anybody else confirm it works with RC5? I was actually going to make the tabs for the page your on active when I made this mod. However this would only easily be done for tabs that link to SMF actions for example when the URL ends in for example action=forum; or action=calendar of course you could still link to any page but only smf actions would have the active tab working. I could add this feature in if enough people want it though.
"Things turn out best for those who make the best of the way things turn out." -Jack Buck

Spoogs

yes it works
Installs right out the box

Bolt™

Please, Please, can you update this for RC5 I really need this mod...

Thank you...

MarcusJ

This is a great mod.  I would be extremely grateful for an update to 2.0 final.

ChaosEnergy

yes, seems not to work in 2.0 final
Chaos Empire ®

CaptainKirk

Quote from: ChaosEnergy on June 16, 2011, 09:27:51 AM
yes, seems not to work in 2.0 final

Well, it actually does work in 2.0, but it depends on what other mods you may have installed and you need to have it be the last mod you install.  At least that's been my experience so far.  I'll be much happier however when an updated version is released expressly to work with SMF 2.0 final.

NanoSector

Works perfectly fine here in a vanilla SMF 2.0 install...
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

MATTEK

Just installed 2.0. The modifications tab doesn't have the Top Menu config tab.
SMF 2.0.1

Like Comics, Books, Movies or T.V. Shows? Read about them here!!

snadge

will not uninstall in 2.0.1 ??

test modification of subs.php files fails

awolexpat

Hi smp420,
Nice mod but I am having a couple of problems getting it to appear where and how I want on custom themes, most notably Blackhead by Crip. I have tried putting the code in the index.template.php in a variety of places but the best I have been able to get so far is almost top centre, slightly to the right; I would really like it far right above whatever else is on the right, sometimes the logo, sometimes the user info/log in depending on the theme, but on Blackhead that pushes the other information to the left. I am going to ask Crip on his theme thread as well but can you give me any pointers?

The other one I am having problems with is flagrant_alt but Blackhead is my main concern. I also want to be able to have the font different colours depending on which theme is selected - I can make it the same colour for all themes by putting the code with the tab title but I'm pretty sure I should be able to do it with the individual css for each theme but need some pointers on how I should do that as I am not that good at coding. I would only want to change the text/tab colours for this, not the whole theme! Do I have to specify a certain name of the div in the css and if so what name? Or some other method? I'll probably be able to get there eventually by myself by bumbling around the code but it would be a great help to have someone who knows what they are doing give some pointers!

T3CHN0

Anyone interested I use this on core them

Index.template.php
find
        // Show the total time logged in?

add before
    // The code for the menu you installed dont you remember it?
   for ($i=1; $i<6; $i++)
      {
         if (!empty($modSettings['tab_url' . $i]) && !empty($modSettings['tab_title' . $i]))
         {
            echo '
                  <a href="';
                    if(!empty($modSettings['newpage' . $i]))
                        echo ' TARGET="_blank"';
                            echo '>
            <span>', $modSettings['tab_title' . $i], '</span></a>';
         }
      }



Looks link this,,, I couldn't get it to work any better then that. >> click image to make bigger<<
see the links for Goolge HotMail and AUR


GlitchPC

I'd like to know how to get this to work on Crip's Anecdota theme, as well.  Crip has replaced the div container of the smf logo with his own code...so, trying to get this mod to install on one of his themes is almost impossible.

So...if anyone has come up with an answer...it sure would be appreciated if you could float some of that info my way.

Thanks, in advance...

T3CHN0

Quote from: GlitchPC on December 09, 2011, 10:36:52 AM
I'd like to know how to get this to work on Crip's Anecdota theme, as well.  Crip has replaced the div container of the smf logo with his own code...so, trying to get this mod to install on one of his themes is almost impossible.

So...if anyone has come up with an answer...it sure would be appreciated if you could float some of that info my way.

Thanks, in advance...
My Main forum is also one from Crip and I find this mod doesn't work on most custom themes unless the theme doesn't have
it's own index.template.php then this mod works fine.

I had a play around for you but no matter what I did. I simply can not get this mod to work on Crips theme's
So I made a little something that will work for you but it's an edit not a mod and to change url's images or link names
you will need to edit it your self.

here is a bit of my themes darkrainv2 by crip
_____________________________________________________________________________________________________
    // If we have new PMs...
    if($context['show_pm_popup'])
    echo '
    <div id="pm_popup" class="windowbg">
    <h5 class="catbg">

        <span class="floatright"><a href="#" onclick="closefPmPopup()"><img src="', $settings['images_url'], '/icons/quick_remove.gif" alt="', $txt['pm_popup_close'], '" /></a></span>
        ', $txt['pm_popup'], ' [', $context['user']['unread_messages'], ']
    </h5>
    <p class="content">
        ', str_replace('\n', '<br />', $txt['show_personal_messages']), '<br /><br />
        <a href="', $scripturl, '?action=pm" target="_blank" onclick="closefPmPopup()"><img src="', $settings['images_url'], '/icons/package_installed.gif" alt="" /> ', $txt['yes'], '</a> &nbsp;&nbsp;&nbsp; <a href="#" onclick="closefPmPopup()"><img src="', $settings['images_url'], '/icons/package_old.gif" alt="" /> ', $txt['no'], '</a>
    </p>
    </div>';

    echo '

        <div id="mainframe"', !empty($settings['forum_width']) ? ' style="width: ' . $settings['forum_width'] . '"' : '', '>
        <div id="ob1">
        <div id="ib1">
        <table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
     <td align="center">';
    echo '

    <a href="'.$scripturl.'" title="', $context['forum_name'], '"><img src="', $settings['images_url'], '/myslogan.png" style="margin: 2px;" alt="', $context['forum_name'], '" /></a>';

    echo '
        </td>
     </tr>
</table>';
     echo '
    <div class="tborder">

        <div class="catbg" align="center">

<a href="http://www.google.com"><img src="', $settings['images_url'], '/google.gif" style="margin: 2px;" alt="', Google, '" /></a><a href="http://www.Hotmail.com"><img src="', $settings['images_url'], '/hotmail.png" style="margin: 2px;" alt="', HotMail, '" /></a><a href="http://www.Yahoo.com"><img src="', $settings['images_url'], '/yahoo.png" style="margin: 2px;" alt="', Yahoo, '" /></a><a href="http://www.YouTube.com"><img src="', $settings['images_url'], '/youtube.png" style="margin: 2px;" alt="', Youtube, '" /></a><a href="http://www.windows.com"><img src="', $settings['images_url'], '/windows.png" style="margin: 2px;" alt="', MSwindows, '" /></a>

        </div>';

    // Display user name and time.
_____________________________________________________________________________________________________________


The part I made BOLD is the part I added my self for custom links.
align="center"                                                     <>>>>You can make it left or right side as well:: I made in center

you will notice the http://www. ??? ??? ?.com       <>>>> you can edit to what you want

$settings['images_url'], '/google.gif"                   <>>>> you can make your own images to show instead of a text name BE SURE to add it to theme/images

alt="',Google,'"                                                    <>>>>The text name that will show if image not found

I hope this helps you out with what you are trying to add to your forum
and if you want more links just simply copy and past the above strings to make more links.


I know it's not the best answer but at least with the above coding you might be able to work something out for your forum.
If I knew how to make modes I would have done it.. But I only know how to trouble shoot and correct mods but not create :(

cheers

GlitchPC

Sorry for the late reply...I decide not to use this mod...due to the issue with custom themes. Anyhow...thanks for the reply and I'm sorry I didn't try your recommendations.

poojim

Somebody know those codes of top menu in the core theme (including the CSS) so I can put it on a different theme that I use; and eventually install this mod?

What about the child pages for this mod?

OnzeDanny

#236
A tip to reduce some code.
Using for conditions, so if you like more menu items its easier to modify.
;)

ORIGINAL:

$config_vars = array(
array('text', 'tab_title1'),
array('text', 'tab_url1'),
array('check', 'newpage1'),
array('text', 'tab_title2'),
array('text', 'tab_url2'),
array('check', 'newpage2'),
array('text', 'tab_title3'),
array('text', 'tab_url3'),
array('check', 'newpage3'),
array('text', 'tab_title4'),
array('text', 'tab_url4'),
array('check', 'newpage4'),
array('text', 'tab_title5'),
array('text', 'tab_url5'),
array('check', 'newpage5'),
);


CHANGED TO:
 
$start = 1;
$config_vars = array();

for ($start; $start < 6; $start++) {
$config_vars[] = array('text', 'tab_title'.$start);
$config_vars[] = array('text', 'tab_url'.$start);
$config_vars[] = array('check', 'newpage'.$start);   
}


and this one:

ORIGINAL

   for ($i=1; $i<6; $i++)
{
$txt['tab_url' . $i] = 'Tab url';
$txt['newpage' . $i] = 'Open tab in new page.';
}
$txt['custom_menu_title'] = 'Top Menu';
$txt['tab_title1'] = '1st tab name';
$txt['tab_title2'] = '2nd tab name';
$txt['tab_title3'] = '3rd tab name';
$txt['tab_title4'] = '4th tab name';
$txt['tab_title5'] = '5th tab name';


CHANGED TO:
$txt['custom_menu_title'] = 'Top Menu';
    for ($i=1; $i<6; $i++)                       
{                                             
$txt['tab_url' . $i] = 'Tab URL';                   
$txt['newpage' . $i] = 'Open in new page';     
$txt['tab_title' . $i] = 'Tab name ' . $i;       
  }                                             

awolexpat

Hi everyone,
I have finally had time to sit down and fiddle with the index template.php and css for my troublesome themes, prompted by the fact that I needed to add an extra button to my top menu! The themes I have played around with and got working are: Blackhead by Crip and flagrant_alt also by Crip. I also have Clear Sky by zutzu but that worked pretty much out of the box I seem to remember.
If anyone wants or needs to see the relevant files from my themes, bearing in mind I have a LOT of mods installed, I would be happy to share what i have done. Essentially though, with Blackhead I had to duplicate and rename the css for the drop down menu and then make various changes there, plus the main bugbear, getting the position to work which needed some (actually a lot) of fiddling around in the index template.php. flagrant_alt was actually a lot easier as by then i had worked out how to do things! Bear in mind that I wanted a particular position for my top menu (top right), and didn't require drop downs.

If anyone wants to look to see what i have done, my forum front page (Simple Portal) allows to change the themes, and you can find it at http://www.awolonline.net/forum/
Not trying to promote my forum, just hoping that it might help someone who has been struggling with getting this implemented on Crips themes.

smp420

Does this work as is on a fresh install of the latest version of smf? If it doesn't I'd be happy to update it if someone can supply a test forum.
"Things turn out best for those who make the best of the way things turn out." -Jack Buck

Djekaster

In result: does anybody knows how to get this mod to be working in any custom theme in RC5? I have 23 themes installed there in my forum (it's a design feature - user can choose which theme they like to use), but only few themes have no error. The most of themes show errors while I'm trying to install this mod. If it's impossible to repair, maybe somebody knows any other mod, which could let me (attention!) re-design the order and the number of buttons on the main top panel? I already installed 6 buttons mod, but it's just adding new buttons, while I need to reduce the total number of buttons hiding some of them into sub-menu. I'd be grateful for any help.

Advertisement: