Help with nav bar

Hy, i have been trying to add more option to my nav bar but it fails, i just want to add contact us,faq,terms and privacy as a drop down button to the bottom of the navigation list please any help? here is the nav bar code

  <?php

    // man navigation items
    $headerNavigation = array();

    // non logged in users
    if (SITE_CONFIG_ENABLE_USER_REGISTRATION != 'no') {
        $headerNavigation['register'] = array(
            'link_url' => coreFunctions::getCoreSitePath() . '/register.' . SITE_CONFIG_PAGE_EXTENSION,
            'link_text' => t('register', 'register'),
            'link_key' => 'register',
            'user_level_id' => array(0),
            'position' => 100
        );
    }

    if (UserPeer::enableUpgradePage() == 'yes') {
        $headerNavigation['premium'] = array(
            'link_url' => coreFunctions::getCoreSitePath() . '/upgrade.' . SITE_CONFIG_PAGE_EXTENSION,
            'link_text' => t('premium', 'premium'),
            'link_key' => 'upgrade',
            'user_level_id' => array(0),
            'position' => 200
        );
    }

    $headerNavigation['login'] = array(
        'link_url' => coreFunctions::getCoreSitePath() . '/login.' . SITE_CONFIG_PAGE_EXTENSION,
        'link_text' => t('login', 'login'),
        'link_key' => 'login',
        'user_level_id' => array(0),
        'position' => 400
    );

    // logged in users
    $headerNavigation['your_files'] = array(
        'link_url' => coreFunctions::getCoreSitePath() . '/account_home.' . SITE_CONFIG_PAGE_EXTENSION,
        'link_text' => t('your_albums', 'your albums'),
        'link_key' => 'your_files',
        'user_level_id' => range(1, 20),
        'position' => 30
    );

    if (UserPeer::enableUpgradePage() == 'yes') {
        $label = t('uprade_account', 'upgrade account');
        if ($Auth->hasAccessLevel(2)) {
            $label = t('extend_account', 'extend account');
        }
        $headerNavigation['upgrade'] = array(
            'link_url' => coreFunctions::getCoreSitePath() . '/upgrade.' . SITE_CONFIG_PAGE_EXTENSION,
            'link_text' => $label,
            'link_key' => 'upgrade',
            'user_level_id' => range(1, 20),
            'position' => 200
        );
    }

    // logged in users
    $headerNavigation['settings'] = array(
        'link_url' => coreFunctions::getCoreSitePath() . '/account_edit.' . SITE_CONFIG_PAGE_EXTENSION,
        'link_text' => t('file_manager_account_settings', 'Account Settings'),
        'link_key' => 'settings',
        'user_level_id' => range(1, 20),
        'position' => 999
    );

Well, It appears that you are using some library that needs an array of navigation items to place in the header.
Which library are you using?

It looks like this array needs to know what page you want it to go to when you click the button.
That is handled in your LINK_URL section. The link is the core-site, then the page you want it to move to when the button is pressed. then, it needs the text you want on the button. Also, the access level if the user is set in place. (This part is for different levels of users such as ADMIN’s can see some buttons and regular users can not see some buttons.) And, the position is most likely where on the nav bar the buttons is placed.

So, to add a button, it appears simple enough to just add one using these options. BUT, to create a drop-down select button, you need to know more info on how to code it. That depends on the library you are using. Some are not set up for drop-downs. In the code you posted, it gives no indication of allowing drop-downs. But, I am guessing the library does allow it. Let us know which library you are using and we can sort it out for you.

1 Like

Thanks for the response but i am sorry i don’t know the library i bought the script so i don’t know much about coding so i think maybe i should send the files that need editing like navigation bar,header_file_manager.inc,header.inc and the pages i want to add which are faq,terms,privacy and contact sorry for the inconveniences this might cause you.Thanks in advance.

Well, if you “bought” the script, it is called a template. Most likely anyways. The name of the template is what we would need to research it for you.

Is it a WordPress template? Where did you buy it from? If you look at the files included with the purchased files, you should see something like a documentation file. Or in the main file, there should be a reference to where it came from. If you purchased it from a reliable source, they should have given you some documentation with it. Look around your package and see what you can find. Or, give us the website you purchased it from.

i actually know all those, it written in php/html/jss/css image hosting script and i know where the template area is, in fact i have done some configurations myself but this particular file is what i don’t know how to edit and configure, and i am sure i bought it from a reliable source. i can’t attach the whole template if you don’t mind.Thanks

Well, you should not post the entire template as that is illegal unless you purchased the right to pass it on.
But, you can post it to me in a private message and I will look at it for you and see if I can help. After I review it, I will delete it so there will not be any legal issues. Or, you can try to locate where the “$headerNavigation” is displayed and show us how it is displayed. Then, we can model the addition for a drop-down.

What I am saying is that the code you posted above is where it creates the various parts of the header display. There must be an area where it decodes that array and displays the parts of it. That area would need to be reviewed to figure out how the array is transformed into the final product that is rendered to the browser.

i actually have full license to modify and share it but if you can give me your email so that i can attach and send the whole template to you.

Sorry for keeping you waiting i have sent it.

Sponsor our Newsletter | Privacy Policy | Terms of Service