PDA


View Full Version : Dynamic Forum / Home Link in Navbar


Pages : 1 2 [3] 4

jcline
03-03-2006, 04:42 PM
I`m using 3.5.4 with cmps V2. Thank you for posting the above. It did not work for me, but I was able to sort it out through your post.

You want to look for the section under the
<!-- nav buttons bar-->
and above the
<if condition=$show['member']">

I put:
<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]/$vboptions[forumurl]$session[sessionurl]"> Forums <else /> <a href="$vboptions[homeurl]?$session[sessionurl]"> Home </if></a></td>
I had changed my forum home page name to portal (for some reason that is what it wanted to link to) and I changed [forumhome] to [forumurl]
not a huge difference from the orignal post, but the changes made it work for me.
Thanks again!


after updating to the VB 3.5.4 and VBA 2.10 the orig. code didn't seem to work right, but your fix worked for me as well :)

TheBeave
03-04-2006, 11:24 PM
This is what worked for me.

<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]/$vboptions[forumurl] $session[sessionurl]"> Forums <else /> <a href="$vboptions[homeurl] $session[sessionurl]"> Home </if></a></td>

FLMom
03-09-2006, 10:41 PM
Okay, I have VB 3.5.4 and am using cmps v2 and I think I found the section that you were all talking about, can someone verify this for me before I start to mess around with this? I am new to all of this and would hate to mess things up :o Where exactly do I put the code and do I delete any of the old code? TIA :)

<!-- / breadcrumb, login, pm info -->

<!-- nav buttons bar -->
<div align="center">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center" style="border-top-width:0px">
<tr align="center">
<if condition="$show['member']">

beduino
04-03-2006, 06:37 PM
Tks to this topic!
Very useful.
cheers
beduino

hypnoparadise
04-05-2006, 06:13 PM
I`m using 3.5.4 with cmps V2. Thank you for posting the above. It did not work for me, but I was able to sort it out through your post.

You want to look for the section under the
<!-- nav buttons bar-->
and above the
<if condition=$show['member']">

I put:
<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]/$vboptions[forumurl]$session[sessionurl]"> Forums <else /> <a href="$vboptions[homeurl]?$session[sessionurl]"> Home </if></a></td>
I had changed my forum home page name to portal (for some reason that is what it wanted to link to) and I changed [forumhome] to [forumurl]
not a huge difference from the orignal post, but the changes made it work for me.
Thanks again!



Sorry, but in what file do i change this? I use versionV 2.10.

beduino
04-05-2006, 09:47 PM
template navbar>breadcrumbs...I think
cheers
beduino

sali
04-06-2006, 03:25 PM
admincp / Style Manager / Edit Styles /Navigation & Breadcrumbs / navbar

I don't have a Style Manager folder in my admincp. I checked my zip file from the original download, and it doesn't have it either. Is there something I'm missing?

Thanks!!!

Sonny

Kingster
05-05-2006, 04:56 PM
Gah. I'm not quite sure what the story is here...

I've added the code:
<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]/$vboptions[forumhome].php?$session[sessionurl]"> Forums <else /> <a href="$vboptions[homeurl]?$session[sessionurl]"> Home </if></a></td>

But it gives me:
http://www.domain.net//index.php?

If I merely remove the last p from the .php, the proper link comes in (except for the fact that it isn't falid due to the last p is missing, i.e., http://www.domain.net/forumindex.ph?). Can someone explain to me why this is occurring?

Additionally, the return to the VBA homepage works properly (as it is just using homeurl), but something is funny about what is happening in that .php piece.

mholtum
05-05-2006, 06:49 PM
I don't have a Style Manager folder in my admincp. I checked my zip file from the original download, and it doesn't have it either. Is there something I'm missing?

Thanks!!!

Sonny

It wont be in the zip as it is a template not a .php file. It is there check again.

Scelus
05-11-2006, 09:07 PM
Is there something additional to do here to make it work with a custom style? Currently I can only get this to work in the default style, but my custom style (which is a child of the default) doesn't change.

mholtum
05-12-2006, 02:16 AM
unless you have edited the custom template directly it will trickle down. Otherwise just edit the custom style.

markymoo
05-18-2006, 04:40 PM
it works good only theres a extra gap space to the next User Settings and so dont look even

Ncturnal
05-18-2006, 04:55 PM
Then you didn't do something correctly.

markymoo
05-18-2006, 06:49 PM
because im trying to put more than 1 in like 3 , 2 is ok but anymore than 2 and jumps across. anyway forget that im ok now. what i really need is a multiple if statement i think but not sure how to do.

[code]
<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]/$vboptions[forumhome].php?$session[sessionurl]"> Trouble Ticket <else /> <a href="$vboptions[bburl]/$vboptions[forumhome].php?$session[sessionurl]"> HelpDesk</if></a></td>

<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]/$vboptions[forumhome].php?$session[sessionurl]"> KnowledgeBase <else /> <a href="$vboptions[bburl]/$vboptions[forumhome].php?$session[sessionurl]"> Trouble Ticket</if></a></td>[/code

the links are wrong above you get the idea...

i want to goto 3 pages from the navbar and show the other 2 links on the navbar pointing back and not anyone being duplicated. i nearly done it, the above will do it for 2 pages but not for 3 as 3 will show the link on the page when i dont need it as im on that page.

so its like this

1st page portal - navbar links are trouble ticket and knowledge
2nd page ticket - navbar links are portal and knowledge
3rd page knowledge - navbar links are portal and ticket

markymoo
05-18-2006, 09:22 PM
ok i done it. :) i cleaned up the code. the portal page portal.php is adv_index so i checked for the forum page index.php which is defined as index, i used a extra if and else statement. for those who dont know this is more than just putting Home link on the navbar. 2 links on navbar over 3 pages so each link isnt shown up on the page your on.


<td class="vbmenu_control"><a href="your home url"> Home</a></td>

<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="vBSupport.php"> Trouble Ticket <else /> <a href="portal.php"> HelpDesk </if></if></a></td>

<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="index.php"> KnowledgeBase <else /> <if condition="THIS_SCRIPT == 'index'"><a href="vBSupport.php"> Trouble Ticket <else /> <a href="index.php"> KnowledgeBase </if></if></a></td>

jon_argent
05-19-2006, 07:05 PM
I can't get it to work for me! :confused: It keeps bringing up the url http://www.landofthepinkbunnies.co.uk/?, and does nothing! Do i need to add the names of the CMPS index and the forums index, if so, the root folder is www.landofthepinkbunnies.co.uk, the cmps is index.php, and the forums is forums.php

Thanks in advance!

jon_argent
05-21-2006, 03:47 PM
Polite bump

jon_argent
05-25-2006, 04:35 PM
another bump... please, someone has to be able to help!! This is important :(

StuntFactoryX
06-01-2006, 06:58 PM
im a newbie but it works!

<if condition="THIS_SCRIPT != 'adv_index'">
<td class="vbmenu_control"><a href="$vboptions[homeurl]?$session[sessionurl]">Home</a></td>
</if>
<if condition="VBA_SCRIPT != 'forums'">
<td class="vbmenu_control"><a href="$vboptions[homeurl]/forum/?$session[sessionurl]">Forums</a></td>
</if>
<if condition="VBA_SCRIPT != 'gallery'">
<td class="vbmenu_control"><a href="$vboptions[homeurl]/photopost/?$session[sessionurl]">Gallery</a></td>
</if>

my cmps is in the root called index.php

my forums are in the root under /forum

my gallary is in the root called /photopost

i took the code molthom wrote and used the code he had for gallary for my forum link and changed the paths. the orig code for forums was sending me to a bad forum link. the only problem w/ that code is in forum and gallary the links still show for all 3. but i can live w/ that.

Finn snor
06-05-2006, 08:33 PM
It works with all letters in blue, however i have the rest of my navbar en white letters. How do i change it from blue to white to make it fit with my skin ?

zooki
06-11-2006, 03:40 PM
Hi guys, anyone having trouble with incorrect links just need to have a look at the code and change it a bit. Maybe you need to take out an extra "/" or you need to make sure your paths correlate with the variables.

DaleBrown
06-14-2006, 07:07 PM
Ok this is all a little all run together ;0 Let me try and explain what I'm looking for in detail and see if there is an option. when you are on the below sections of the site this is how I want the breadcrumb to look.

"Home" always refers to the root (VBadvanced CMPS)

"Forums" Always refers to the Forums Root

1. When on Main Home Page Breadcrumb looks like this:

Home

2. When on the Forums Main page:

Home > Forums

3. When anywhere in the forums the breadcrumb looks like this:

Home > Forums > bla bla bla

4. When in Gallery (Photopost) breadcrumb looks like this:

Home > Gallery > etc.....

I always want HOME to be the first link in breadcrumb and send you to main page

Hope this is clear. :)

DomP
06-17-2006, 03:09 AM
did this change for 3.6 beta ?

any help is appreciated :-)

mholtum
07-05-2006, 05:56 PM
should still work

DarkSoul
07-07-2006, 01:16 PM
I cannot get this to work, Whenever i add said code in said place, my menu "Quick Links" show up above my shoutbox. and totally displace the entire page.

what am i doing wrong?

Jimbo
07-15-2006, 09:23 PM
I have this installed, and working fine.

The only [slight] problem I have is in gallery. I do not get a forum link i.e.

CMPS
Forum Gallery Links Usercp etc.

Forum
Home Gallery Links Usercp etc.

Gallery
Home Gallery Links Usercp etc.

Links
Home Forum Gallery Links Usercp etc.

Note that in gallery and links, I also get a link to the same page.

Does anyone know the fix to this? - I have searched the topic and cannot see the answer.

Code used is :-
<if condition="THIS_SCRIPT != 'adv_index'">
<td class="vbmenu_control"><a href="$vboptions[homeurl]?$session[sessionurl]">Home</a></td>
</if>
<if condition="defined('VBA_SCRIPT')">
<td class="vbmenu_control"><a href="$vboptions[bburl]?$session[sessionurl]">Forums</a></td>
</if>
<if condition="VBA_SCRIPT != 'gallery'">
<td class="vbmenu_control"><a href="$vboptions[homeurl]/gallery/?$session[sessionurl]">Gallery</a></td>
</if>
<if condition="VBA_SCRIPT != 'links'">
<td class="vbmenu_control"><a href="$vboptions[homeurl]/links/?$session[sessionurl]">Links</a></td>
</if>

Cheers,
Jimbo

hex4
07-17-2006, 07:23 AM
what if I need to have something like this:

Homepage (cmps_index.php)
-Forums- -FAQ- -Members List- -Calendar- -Search- -Log Out-

and in the Forums page (index.php)
-Home- -User Cp- -FAQ- -Members List- -Calendar- -Search- -Log Out-

interfx
09-24-2006, 12:07 AM
This works great, but I am now trying to add "Chat" to my nav menu...

Here's what I did

created a new page in VBa (identified as "chat") in which I integrated (flashchat) into a template which is on that custom page (chat).

then in my navbar I added this line

<if condition="defined('chat')">
<td class="vbmenu_control"><a href="$vboptions[bburl]/chat/flashchat.php">
Chat</a></td>
</if>

It's not working??? Any ideas out there?

SLGR
10-04-2006, 08:19 AM
I upgraded to 3.6.1.
On forums page, the link back to the main works wonderfully.
But, the link on the main page to the forums page, does this:

http://www.yourdomainname.com/forum//index.php. Why the second line is added?

CordlezToaster
10-18-2006, 01:04 AM
Okay this is what happens in vBulletin 3.5.2. When you try to find in the template:

The term comes up in several places in the template. Every time you hit the "find" button it finds more instances of it. You want to insert the modification above the second instance of it in the template.

You have to hit the "find" button twice or it will be put in the wrong place. When you find it, insert above it:

and you should be good.


Thank you this works GREAT!!

eclectica
10-24-2006, 08:57 PM
One thing I discovered about this fix, is that while it may be more aesthetically pleasing to see your yoursite.com/ than yoursite.com/?, the latter is preferable because it works for people who can not use cookies or have them blocked. Otherwise the session link will fail because it will be yoursite.com/index.phps=sesssionhash instead of yoursite.com/index.php?s=sessionhash. So those two question marks before $session in the added template modification serve a practical though aesthetically unpleasing purpose.

Black Cobra
11-17-2006, 01:53 AM
This doesn't work for the gallery 2.1

mholtum
11-17-2006, 02:27 AM
You might have to change the code a bit. I have it working on my site. http://www.ravensrealm.net Cant remember if I had to change anything.

Skavenger
11-25-2006, 03:29 AM
How can i make this?

On Index
Forums / Gallery

On Forums
Home / Gallery

On Gallery
Forums / Gallery






This doesn't work for the gallery 2.1
use this
<if condition="PP_SCRIPT == 'vBGallery'">

JohnnyBGood
11-25-2006, 01:06 PM
Hi guys,

I used the code as specified in my navbar template and it seems to work fine other than one small problem.

The 'home' link takes me to my root, but the 'forum' link takes me to /forums/cmps_index.php instead of /forums/index.php.

For the life of me I can not work out what is wrong here.

Thanks,

John

JohnnyBGood
11-25-2006, 01:31 PM
I found a solution. Basically I removed some of the code, so the URL I get for 'Forum' is now:

a href="$vboptions[bburl]"

/John

The dman
12-06-2006, 05:11 PM
If someone would have a moment to help it would be appreciated.

My cmps portal is index.php and my forums portal is forums.php. I have my forums installed in my root directory and I have tried everything in this thread and still can't get the forums navbar link in cmps to go to my forums. Could any body spell it out in simple terms?

Thanks

StuntFactoryX
12-06-2006, 09:50 PM
im taking a shot in the dark.. but did you try going to

admincp > cmps > default settings and make sure you changed cmps_index to index

then

admincp > vboptions > forum homepage options and rename index to forums

im not sure if its the solution.. just a idea?

The dman
12-06-2006, 10:04 PM
StuntFactoryX

Yes this is set up correct.

Allthough

admincp > cmps > default settings,cmps_index is set to forums.php

StuntFactoryX
12-07-2006, 12:32 PM
StuntFactoryX

Yes this is set up correct.

Allthough

admincp > cmps > default settings,cmps_index is set to forums.php


that could be the problem.. that setting is calling for what u remamed your vbadvanced to if you changed on set up.. by default it should be cmps_index.php.. many renamed this to index.php so when yo go to yoursite.com it comes up.

the second setting is calling for what you renamed your original vbulletin index.php too if you changed it to make vbadvanced/vbulletin work together in the root. and i think its set to index by default.

im assuming that you renamed your cmps_index.php to index.php and your origional vbulletin index.php to forums.php

The dman
12-07-2006, 12:52 PM
im assuming that you renamed your cmps_index.php to index.php and your origional vbulletin index.php to forums.php

Yes

The dman
12-08-2006, 09:13 AM
I just solved my problem I used this script from Dorfdad and edited it

<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="http://www.mysite.com/forums.php"> Forums <else /> <a href="$vboptions[homeurl]$session[sessionurl]"> Home </if></a></td>


I'm hoping it's ok to do this and I won't screw anything up.

Black Cobra
12-12-2006, 01:49 AM
How can i make this?

On Index
Forums / Gallery

On Forums
Home / Gallery

On Gallery
Forums / Gallery







use this
<if condition="PP_SCRIPT == 'vBGallery'">


Sorry that did not work for me...

vectra-c.com
12-20-2006, 03:08 PM
I want "Home" or "Forums" in the navbar to be in red or green or other colors. How do you write the code? And where should it be inserted? Where can I find out the color codes for the text or characters?

I don't know anything about coding, but I have no problems in following precise instructions. Thanks for helping out.Just add a colour tag around the forum and home bits of text.

i.e. <td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]?$session[sessionurl]"> Forums <else /> <a href="$vboptions[homeurl]?$session[sessionurl]"> Home </if></a></td>will become.....<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]?$session[sessionurl]"><span style="color:xxxx">Forums</span><else /> <a href="$vboptions[homeurl]?$session[sessionurl]"><span style="color:xxxx">Home</span></if></a></td>where xxxx is the colour that you want - red, orange or whatever other colour name.

HTH

Duncan

Niteflyer
01-01-2007, 07:02 PM
Taken from this (http://www.vbadvanced.com/forum/showthread.php?t=41&highlight=dynamic+forum+home) post. Numerous people have been saying "the code isn't there in 3.5, what do I do?" SO I thought I would help them out.

In the Navbar template find:

<if condition="$show['member']">

it is aprox. line number 91.
Above that add:

<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]/$vboptions[forumhome].php?$session[sessionurl]"> Forums <else /> <a href="$vboptions[homeurl]?$session[sessionurl]"> Home </if></a></td>

There you have it. Easy money.

This does work for me by adding appropriate home and forum buttons,however once i do this,the header gif disappears in the forums.everything looks and works good though on the home page.

any idea's thanks

bugriders
01-13-2007, 04:40 AM
On my site they showed up in the header instead of the navbar. Maybe I forgot something in the code. But like this I like it because otherwise there is not enough place in the navbar.

For example if I click on Chat then he opens in the same browser. I want a target="blank", but not sure where to put it in the template?

<if condition="THIS_SCRIPT != 'chat'">
<td class="vbmenu_control"><a href="$vboptions[homeurl]/forum/chat/
$session[sessionurl]">Chat</a></td>
</if>

bugriders
01-13-2007, 04:42 AM
On my site they showed up in the header instead of the navbar. Maybe I forgot something in the code. But like this I like it because otherwise there is not enough place in the navbar.

For example if I click on Chat then he opens in the same browser. I want a target="blank", but not sure where to put it in the template?

<if condition="THIS_SCRIPT != 'chat'">
<td class="vbmenu_control"><a href="$vboptions[homeurl]/forum/chat/
$session[sessionurl]">Chat</a></td>
</if>

http://www.bugriders.be

Geek
01-27-2007, 12:35 PM
This worked great, thanks! I do have one minor issue still.

On my portal page the root of the forum tree is not coming up, all I get is the little open folder. Once I go into my forums section, it comes up fine. See attached images(Picture 1 is of my portal, Picture 2 is of my forums page)

Also, I get the URL of the forum on the portal page in the title bar of my browser instead of the name of the forum.

Any ideas?

titodj
03-06-2007, 01:42 PM
Thanks this worked fine for me...


Taken from this (http://www.vbadvanced.com/forum/showthread.php?t=41&highlight=dynamic+forum+home) post. Numerous people have been saying "the code isn't there in 3.5, what do I do?" SO I thought I would help them out.

In the Navbar template find:

<if condition="$show['member']">

it is aprox. line number 91.
Above that add:

<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]/$vboptions[forumhome].php?$session[sessionurl]"> Forums <else /> <a href="$vboptions[homeurl]?$session[sessionurl]"> Home </if></a></td>

There you have it. Easy money.

mustang2000
03-29-2007, 01:19 PM
how do you do this for vb 3.6.5?

because you can't find the code in the 'navbar' template in 3.6.5 that has been listed so far?

or i haven't seen it?