Comments |
Re: Main Links Set To Current Style
|
The variable $breadcrumbs['address'] contains the link for the current page.
If you grep for: grep -rn "$breadcrumbs\['address'\]" * you'll find it's used in pretty much every page.
Inside a template it's the 'BREADCRUMBS_ADDRESS' variable.
HTH
John
|
jhl [ Thu 09 Aug, 2012 19:31 ]
|
|
Re: Main Links Set To Current Style
|
Thanks for the tip John
I couldnt see that for looking, new there was a navigation style in icy but totally forgot about the breadcrumbs.
Thanks
Mike
extra comments
I have just had a look at the breadcrumbs which would work ideally but I dont believe they will with what I am trying to do.
I need the links to appear in overall header like the image below...
I have a few custom pages using cms pages and I thought there might be an easy way to show the current page using present code...
the breadcrumb system would work if I needed to show the current page without any other links but I need the other links to show too.
as I said if this was standard pages in icy then I wouldnt have a problem, it is the cms custom pages that I cannot make it work on.
thanks for your help
|
DWho [ Fri 10 Aug, 2012 13:23 ]
|
|
Re: Main Links Set To Current Style
|
This should give you something to mess with,. Just drop it all into overall_header.tpl and have a "PLAY"?
The Script:
<div id="stylemenu">
<ul>
<?php if (basename($_SERVER['SCRIPT_NAME'], '.' . PHP_EXT) == 'index'){ ?>
<li><a href="index.php" class="current">Home</a></li>
<?php }else{ ?>
<li><a href="index.php">Home</a></li>
<?php } if (basename($_SERVER['SCRIPT_NAME'], '.' . PHP_EXT) == 'forum'){ ?>
<li><a href="forum.php" class="current">Forum</a></li>
<?php }else{ ?>
<li><a href="forum.php">Forum</a></li>
<?php } ?>
<!-- AND SO ON -->
<li><a href="new.php">New</a></li>
<li><a href="profile.php">Profile</a></li>
<li><a href="search.php">Search</a></li>
<li><a href="faq.php">FAQ</a></li>
</ul>
</div>
The CSS:
<style type="text/css">
#stylemenu{ position: absolute; top: 0; right: 10px; margin: 0px 0px 0px 0px; display:block;font-size:13px;font-weight:bold;background:transparent;font-family:Arial,Verdana,Helvitica,sans-serif;}
#stylemenu ul{margin:0;padding:0;list-style-type:none;width:auto;}
#stylemenu ul li{ display:block;float:left;margin:0px; padding-left:10px; }
#stylemenu ul li a{
display:block;
float:left;
color:#ff0000;
text-decoration:none;
padding-left:15px;
padding-right:15px;
padding-top:10px;
padding-bottom:5px;
height:20px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
#stylemenu ul li a:hover,#stylemenu ul li a.current{color:#fff; background: #0000ff;}
</style>
|
mort [ Sat 11 Aug, 2012 05:25 ]
|
|
Re: Main Links Set To Current Style
|
Thank you Mort
Works like a charm
|
DWho [ Sun 12 Aug, 2012 12:56 ]
|
|
Re: Main Links Set To Current Style
|
You're welcome.
If you are actually using the CSS you can drop this from it (if you haven't already done it?
position: absolute; top: 0; right: 10px;
and use this to slot it in wherever you want it etc.
<tr>
<td>
<div id="stylemenu">
BLAH!
</div>
</td>
</tr>
|
mort [ Sun 12 Aug, 2012 13:12 ]
|
|
Re: [SOLVED] Main Links Set To Current Style
|
It was a bug... please change it like this:
'SCRIPT_NAME' => str_replace('.' . PHP_EXT, '', $user->page['page_name']),
|
Mighty Gorgon [ Tue 14 Aug, 2012 19:55 ]
|
|
Re: [SOLVED] Main Links Set To Current Style
|
Thanks Luca
Spent ages trying to make it work using your code and nearly gave up.
code changed works as it should.
|
DWho [ Wed 15 Aug, 2012 11:27 ]
|
|
Re: [SOLVED] Main Links Set To Current Style
|
code changed works as it should.
HA! So now you have two ways of doing it.
One for php (Change the CONSTANT), and one solely for phpBB (Icy Phoenix).
|
mort [ Sat 18 Aug, 2012 07:38 ]
|
|
Re: [SOLVED] Main Links Set To Current Style
|
My thoughts exactly..
|
DWho [ Sat 18 Aug, 2012 15:23 ]
|
|
Re: [SOLVED] Main Links Set To Current Style
|
One for php (Change the CONSTANT), and one solely for phpBB (Icy Phoenix).
If you want your solution to be fully independent from phpBB (Icy Phoenix) you should remove the constant PHP_EXT and use 'php' instead.
|
Mighty Gorgon [ Sun 26 Aug, 2012 11:00 ]
|
|
Re: [SOLVED] Main Links Set To Current Style
|
Update: Informpro made this for me: put it in your CFG file:
- $page = explode('/', $_SERVER['SCRIPT_NAME']);
- $page = substr(end($page), 0, -4);
- if ($page == 'index') { $images['current'] = 'current'; }
- if ($page == 'blog') { $images['current'] = 'current'; }
- if ($page == 'about us') { $images['current'] = 'current'; }
- if ($page == 'contact us') { $images['current'] = 'current'; }
- if ($page == 'package') { $images['current'] = 'current'; }
- if ($page == 'login') { $images['current'] = 'current'; }
In your header, you simply will have to add {current} inside the class, such as:
- <a href="index.php" class="{current}">Home</a>
- <a href="forum.php" class="{current}">Forum</a>
- <a href="blog.php" class="{current}">Blog</a>
Well, if there aren't any other classe to define you can even get some space by using this, I guess:
- if ($page == 'index') { $images['current'] = 'class="current"'; }
- <a href="index.php" {current}>Home</a>
and define your class in the css, for example:
- .current {background-color:blue}
Obviously, this require you to set up the array for the $image['current'] variable but you can use it to define it automatically: - foreach ($images as $k => $v)
- $template->assign_var(strtoupper($k), $v);
Well, that's all some tips from Informpro, I'm just sharing. Hope this help.
|
Yros [ Fri 12 Oct, 2012 14:32 ]
|
|
|