Flux cp Navi links

LordOdin

New member
Messages
13
Points
0
Github
None
Emulator
rAthena
Hi guys,

I would like to ask some of the more experience web developers on here how do i make a navigation bar with flux cp, ie

instead of a drop down menu

main menu -> home,news, downloads,rules | Accounts -> etc

to

Home, about,download,forum,shop,vote

single links

hope you understand

Kind regards

 
Actually, I did not understand anything at all. Give more details.

 
A|t the moment the php inside navi.php file is

<?php if (!defined('FLUX_ROOT')) exit; ?>

<div class="navbar navbar-inverse" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<?php $menuItems = $this->getMenuItems(); ?>
<?php if (!empty($menuItems)): ?>
<?php foreach ($menuItems as $menuCategory => $menus): ?>
<?php if (!empty($menus)): ?>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo htmlspecialchars(Flux::message($menuCategory)) ?> <b class="caret"></b></a>
<ul class="dropdown-menu">
<?php foreach ($menus as $menuItem): ?>
<li>
<a href="<?php echo $menuItem['url'] ?>"><?php echo htmlspecialchars(Flux::message($menuItem['name'])) ?></a>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endif ?>
<?php endforeach ?>
<?php endif ?>

<?php $adminMenuItems = $this->getAdminMenuItems(); ?>
<?php if (!empty($adminMenuItems) && Flux::config('AdminMenuNewStyle')): ?>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Admin Menu <b class="caret"></b></a>
<ul class="dropdown-menu">
<?php foreach ($adminMenuItems as $menuItem): ?>
<li>
<a href="<?php echo $this->url($menuItem['module'], $menuItem['action']) ?>"><?php echo htmlspecialchars(Flux::message($menuItem['name'])) ?></a>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endif ?>

</ul>
</div><!--/.nav-collapse -->
</div>
</div>

basically takes the normal side panel menu and but it into a navi bar as dropdown menus what i would like to achieve is single links instead of the drop down menu, ie a link going to home etc i know how to do html5 with bootstrap thats not the problem is turning the php parts into just single links instead of using the default flux side panel menu

 
Remove the drop down classes and just have

                            <?php foreach ($menus as $menuItem): ?>
                                <li>
                                    <a href="<?php echo $menuItem['url'] ?>"><?php echo htmlspecialchars(Flux::message($menuItem['name'])) ?></a>
                                </li>
                            <?php endforeach ?>

So that it's like this:

<?php if (!empty($menus)): ?>
<?php foreach ($menus as $menuItem): ?>
<li>
<a href="<?php echo $menuItem['url'] ?>"><?php echo htmlspecialchars(Flux::message($menuItem['name'])) ?></a>
</li>
<?php endforeach ?>
<?php endif ?>

Basically removes the category's title and just adds the category links without the dropdown. 

 
Thank you so much Mysterious perfect.

okay its not what i meant on the whole,

what i would like to do is have a main navigation top of the page i have that with the default flux menus but what i would like is home downloads, about etc ie

<ul>
<li><a href="<?php something goes here?>">Home</a></li>
<li><a href="<?php something goes here?>">About</a></li>
<li><a href="<?php something goes here?>">downloads</a></li>
<li><a href="<?php something goes here?>">etc</a></li>
</ul>


i dont understand PHP code, so any help with this will be appreaciated

Kind regards

 
Last edited by a moderator:
Thank you so much Mysterious perfect.

okay its not what i meant on the whole,

what i would like to do is have a main navigation top of the page i have that with the default flux menus but what i would like is home downloads, about etc ie

<ul>
<li><a href="<?php something goes here?>">Home</a></li>
<li><a href="<?php something goes here?>">About</a></li>
<li><a href="<?php something goes here?>">downloads</a></li>
<li><a href="<?php something goes here?>">etc</a></li>
</ul>


i dont understand PHP code, so any help with this will be appreaciated

Kind regards
So then what you want to do is use this code:

<?php echo $this->url(''); ?>
 


Basically:

  • Home URL - <?php echo $this->url(''); ?>
  • Downloads - <?php echo $this->url('downloads'); ?>
  • etc.

Keep in mind the name of your module goes in between the ' '. 

 
Use the title of the page created. I haven't used a CMS for flux, so not 100% sure. But use the page title. 

 
ive tried using the page title but it errors

Code:
Page Not Found

The page you have requested was not found on our server. Please check the address and make sure it is correct, and try again.

/?module=about
 
I think you're going to have to add this to your application.php

// Sample items for pages function.
'Downloads' => array('module' => 'pages','action'=>'content&path=downloads')

 
Back
Top