You would need to write some condition that is unique to whatever "Listings" is. I don't know anything about that page since it isn't a default vb page (or is it and you are just calling it something else?), so I don't know what the condition would be. If it's a custom page, then define THIS_SCRIPT at the top of the php page, like it is defined on other vB pages, and then you can use that in the condition.
|
Lynne,
Please be gentle with me on this...I've looked over your instructions...and I'm sitting here scratching my head. I have a mod installed called Chatbox Evo. There is no option in this mod to add a link to the navbar, or to the community link menu. I want to add a new tab on the navbar that opens the chatbox in full-page mode. I want to name this tab "Chat"...and it will be viewable by all who visit the site. The link to call the full-size chatbox is as follows: Code:
http://www.glitchpcforums.com/forum/mgc_cb_evo.php?do=view_chatbox |
Not really. I don't know anything about the code for that mod. You may want to ask the developer if there is a THIS_SCRIPT set on that page that you can use in the condition. Then you could do something like:
PHP Code:
|
Quote:
Thank you for the reply... Yes, there is a THIS_SCRIPT set on the page: Code:
define('THIS_SCRIPT', 'mgc_cb_evo'); Can you provide me with the code, or the modifications from your code...in order for me to complete this? I don't want to remove any lines of code from what you have given us...and leave myself hanging. I do understand coding...a little, but don't want to leave myself in a bind. Thanks, in advance... |
This is PERFECT for creating only a TAB, this is what I was looking for.
Quote:
|
Update...
Got 'er done! Thanks for the help...much appreciated. |
Quote:
|
Hi Lynne, I've read through a few of the posts here regarding having the forum tab highlighted along with the new tab. I added the tab fine, I'm using a UserCP tab, but the forum tab is highlighted when I click it.
Here's my plugin code Code:
if (THIS_SCRIPT == 'UserCP') // also defined('UserCP') possible |
There is not default vbulletin script named "UserCP", so is this on a custom page? And, you cannot have a template called "UserCP Nav Bar" - you may not have spaces in a template name.
I really don't get what you are doing with your plugin code at all and I don't see the tab code in there either. |
This is working just fine for me, and (as usual!) thank you, Lynne. :)
One quick question, here's my code - I'm just adding a link to vaispy. Everything works as it should, and I just removed the default dropdown menus from your code. Code:
$tabselected = ''; Thanks! |
You would need to copy the submenu code from the navbar to add it to your tab. I think someone asked about this before recently, and they were pointed to ragtek's article about adding a navtab since he used a template and it was easier to copy/paste the code using his template method. So, you may want to check out his similar article.
|
This tutorial was very helpful. Thank you!
|
As always, great article Lynne!
Thank you |
Can this method be used to add a tab to the navbar that opens a new browser window to an external website? I don't need any submenus, just a link to another site in its own window.
|
Yes. You just need the last line though:
HTML Code:
$template_hook['navtab_end'] .= '<li><a class="navtab" href="link.php" target="_blank">Link Name</a></li>' ; |
Nice! Thanks!
The target="_blank" doesn't work to open a new browser window, at least not at my site: Shout Street Click on 'Zip Code Maps' |
Sorry, the board is unavailable at the moment while we are testing some functionality.
We will be back soon... |
Heh, but the navbar is still active for this, it works the same either way - board on or off.
|
Okay, I just tried that link on my site with a target="_blank" in it and it opened another tab fine for me in Opera.
|
How can I make my new tab appear first in the list? Using 'navtab_start' makes it the second tab but not the first.
EDIT: Figured it out.. You add in navtab_start then change the execution order from 5 to 4. |
Quote:
|
Quote:
HTML Code:
<li><a class="navtab" href="http://www.usnaviguide.com/">Zip Codes Map</a></li> |
If you are trying to make a tab that links to an already established page such as "content.php?139-blog", I found a solution:
First modify your plugin to include the end piece of your url in this case "/content.php?139-blog". This will enable your tab to be highlighted. PHP Code:
Change this: PHP Code:
PHP Code:
|
Of course both will highlight - the THIS_SCRIPT constant condition is true for the normal CMS tab, too. You need to edit the CMS tab condition to not highlight.
|
Quote:
Thanks! |
Quote:
|
Thank you for this writeup Lynne, I used a modified version of it to add a "Home" tab to my forum.
Jerry |
1 Attachment(s)
First let me say, great mod.
I have gotten the tab to work but I would like to resolve one issue if I can. When I click on the tab it brings me to my gallery and the proper tab gets highlighted and stays highlighted. But when I click on the link under the tab "New in last day" then it opens in the gallery again like it is suppose to but it defaults to the "What's New" tab. I would like it to stay in the Gallery Tab that I created and stay highlighted. Is there a way to do this? Here is my code and the sample navbar image. PHP Code:
|
New in Last Day is a search? So, the condition for highlighting the search page are being met. You will need to rewrite the condition to highlight the search page to say "but not when doing New in Last Day" and then rewrite the gallery one to include "when doing New in Last Day".
|
Hi lynne how do i make the work for forum uses only eg not guests thanks
Quote:
|
Quote:
|
Quote:
|
It's right near the top of this artilces forum - vB4 Template Conditionals List
|
Lynn So all i should do is just create plugin and put the code
PHP Code:
Thanks alot! |
Quote:
|
Lyyne,
Im happy that it added to the navbar, but that keep "Forum" tab selected and show the "Forum" sublinks. PHP Code:
|
Is there a page that has THIS_SCRIPT defined as "albumtab"? If not, then the subnav will never show and the tab won't be highlighted. Your condition needs to be a valid, unique condition.
|
OK i got it, THIS_SCRIPT apear in the php file.
But what if i want to redirect to page such as www.site.com/content.php?r=5-News ? I cant do that? Thanks alot! |
Sure you can redirect to that - why can't you? If you want to have the tab highlighted at that time, then you will need to write a unique condition for it (when r == 5-News) and most likely modify the condition for when the CMS Home tab shows up to NOT be highlighted if r == 5-News.
|
Im having problems with getting tabs to show for only one usergroup
Im guessign its a case of using an IF statement but i cant work out where it needs to go or what needs to be in it my site the final link to the team portal i want to be visable to only one user group (game crew (id 9)) but i cant work out how to do it :P im still trying to get my head around the new coding and ways of doing things the site is mainly just a test at the moment however once i have it working i will be putting the ideas in to use on the main forum Thanks for the great guide Lynne its been really helpfull PS. Sorry if someone has already asked this |
All times are GMT. The time now is 02:45 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|