Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
[HOW TO - vB4] Create a New Tab in the navbar (with template)
ragtek
Join Date: Mar 2006
Posts: 1,630

austria, croatia
by ragtek ragtek is offline 18 Nov 2009
Rating: (2 votes - 5.00 average)

I know that lynne allready postet an article, but here's a other way:

This tutorial will show you, how to add own links to your navbar.
(In the tutorial i'll use the code for my news add-on)


1. create a template (ragtek_news_navbar)

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

2. Create a plugin at the hook process_templates_complete

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

As you see, i've defined "ragteknews" on my news.php page.If ragteknews is defined, $vbulletion->options['selectednavtab'] will be set to ragteknews.
Thats important because where using a condition in the template:
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Attached Images
File Type: png Forums_1258596385528.png (7.9 KB, 2687 views)
File Type: png Forums - News_1258596373538.png (11.1 KB, 3062 views)

Last edited by ragtek; 05 Dec 2009 at 21:34..
Views: 39028
Reply With Quote
Comments
  #2  
Old 18 Nov 2009, 20:07
taffy056 taffy056 is offline
 
Join Date: Sep 2004
Can I ask where do you place the plugin?

In truth I am getting a bit lost with this, why can't the CMS simply place links where you want them, I like subdreamer's way of doing this I think!
Reply With Quote
  #3  
Old 18 Nov 2009, 20:16
ragtek's Avatar
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Sorry, strange that it's gone away. I've edited my post

And the hook is process_templates_complete
__________________
my addons: http://ragtek.github.com
Reply With Quote
  #4  
Old 19 Nov 2009, 02:33
LoveStream LoveStream is offline
 
Join Date: Jan 2009
Originally Posted by ragtek View Post
Sorry, strange that it's gone away. I've edited my post

And the hook is process_templates_complete
Thank you. I hope it.
Reply With Quote
  #5  
Old 21 Nov 2009, 01:10
Hoagie's Avatar
Hoagie Hoagie is offline
 
Join Date: Oct 2004
Man this is awesome. When I am displaying the page I created the forums tab is still highlighted....am I missing something or did I forget to change something.....

Thanks for the help!
Attached Images
File Type: png ranks.png (73.6 KB, 1035 views)
Reply With Quote
  #6  
Old 21 Nov 2009, 07:56
ragtek's Avatar
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
whats your code?
__________________
my addons: http://ragtek.github.com
Reply With Quote
  #7  
Old 21 Nov 2009, 15:25
Hoagie's Avatar
Hoagie Hoagie is offline
 
Join Date: Oct 2004
Which code? The plugin code?
Reply With Quote
  #8  
Old 21 Nov 2009, 16:40
ragtek's Avatar
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Plugin and template code
__________________
my addons: http://ragtek.github.com
Reply With Quote
  #9  
Old 21 Nov 2009, 16:59
VonDoom's Avatar
VonDoom VonDoom is offline
 
Join Date: Dec 2008
Very cool and simple, thanks for this.
__________________
Reply With Quote
  #10  
Old 21 Nov 2009, 17:18
Hoagie's Avatar
Hoagie Hoagie is offline
 
Join Date: Oct 2004
Plug In Code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Template Code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #11  
Old 21 Nov 2009, 23:32
Anseur's Avatar
Anseur Anseur is offline
 
Join Date: Jun 2004
Is your templace called "member_ranks" or something else?
Reply With Quote
  #12  
Old 22 Nov 2009, 03:33
Hoagie's Avatar
Hoagie Hoagie is offline
 
Join Date: Oct 2004
Its called vbcms_ranks

Please tell me its not that simple.......I knew it would be something simple I was over looking...
Reply With Quote
  #13  
Old 23 Nov 2009, 00:32
Zaiaku's Avatar
Zaiaku Zaiaku is offline
 
Join Date: Jul 2007
Perfect! I didn't want to have to edit the files especially since its in beta.
__________________
Live everyday as if it was your last, because one day it just may be.
Reply With Quote
  #14  
Old 23 Nov 2009, 06:47
ragtek's Avatar
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Originally Posted by Hoagie View Post
Plug In Code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Template Code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
And what's with the template for the navbar?
I think you made it completely false
__________________
my addons: http://ragtek.github.com
Reply With Quote
  #15  
Old 23 Nov 2009, 18:38
Hoagie's Avatar
Hoagie Hoagie is offline
 
Join Date: Oct 2004
vbcms_navbar_add

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 14:49.

Layout Options | Width: Wide Color: