Jump to content
  • 0
LordOdin

Flux cp Navi links

Question

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

9 answers to this question

Recommended Posts

  • 0

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 ' '. 

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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. 

Share this post


Link to post
Share on other sites
  • 0

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 by LordOdin

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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')

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.