LordOdin 0 Posted February 27, 2017 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 Quote Share this post Link to post Share on other sites
0 Mystery 594 Posted February 27, 2017 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 ' '. 1 LordOdin reacted to this Quote Share this post Link to post Share on other sites
0 Envolvents 7 Posted February 27, 2017 Actually, I did not understand anything at all. Give more details. Quote Share this post Link to post Share on other sites
0 LordOdin 0 Posted February 27, 2017 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 Quote Share this post Link to post Share on other sites
0 Mystery 594 Posted February 27, 2017 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. 1 LordOdin reacted to this Quote Share this post Link to post Share on other sites
0 LordOdin 0 Posted February 27, 2017 (edited) 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 Edited February 27, 2017 by LordOdin Quote Share this post Link to post Share on other sites
0 LordOdin 0 Posted February 28, 2017 What if the link is for the cms page? kind regards Quote Share this post Link to post Share on other sites
0 Mystery 594 Posted February 28, 2017 Use the title of the page created. I haven't used a CMS for flux, so not 100% sure. But use the page title. Quote Share this post Link to post Share on other sites
0 LordOdin 0 Posted February 28, 2017 ive tried using the page title but it errors 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 Quote Share this post Link to post Share on other sites
0 Mystery 594 Posted March 2, 2017 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') Quote Share this post Link to post Share on other sites
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
Share this post
Link to post
Share on other sites