PDA

View Full Version : Conditional navbar appearing based on StyleID


theMusicMan
12-12-2004, 11:10 AM
Hi Brian and All

Here's an interesting issue I hope to be able to sort. It relates to the function where the navbar can be turned off on the portal CMPS main page. However, this is then turned off for all available styles!! What happens here is dependant on certain criteria as follows:

3 styles available as a user choice, say a,b and c.
Overall Board default style = a
Style a (default style) has navigation buttons in the header and so no navbar is required on portal.
Style b has navigation buttons in the header and so no navbar is required on the portal.
Navbar turned off for CMPS
Stytle c is the vBulletin white style.

Now then, all users can select all styles and therefore all styles are available as CMPS Portal pages. However, on the default vBulletin style c there is no navbar shown on the portal page because it is turned off for all styles in CMPS Options.

When users select Style c and display the portal, there is no way to navigate anywhere except by clicking in a post in the news summary module or latest posts module. Of course, when in the forum, the navbar reappears and all is OK.

What I could do is amend the header to include navigation liks for the c style, or alternatively I could check for which styleID is being used by the user and turn on the navbar...?

Which one is easiest..?

Brian
12-12-2004, 11:35 AM
<if condition="$styleid == C">
$navbar
</if>

That should take care of the problem. :)

Our Sponsors
 

theMusicMan
12-12-2004, 11:58 AM
Thanks Brian... simple as that eh,...;)

Can you tell me please where the $navbar template is called from...? Is it Fourmhome?

EDIT: No no no... of course not... that's for vB Forum pages... I need to put the navbar on the avd_portal page yeah....:)

So, I wrapped the $navbar in that conditional, using styleID as per my forum, but the navbar still doesnt show for that style?? Should I turn on the nav bar in CMPS options then amend each style adv_portal template?

Also... does the statement you made mean equal to c or not equal to c...?

Cheers Brian

theMusicMan
12-12-2004, 12:16 PM
Hey Brian

Sheesh - thanks to your help and support here I am learning fast. I really am grateful to you for this help, thanks a million.

It all works 100% now.

However, what I did was to enable the navbar in CMPS options and use that code in each of my other templates to turn it off where there is a navbar in the header and hence I don't need the vB header on the CMPS page. Is there a way I could put some code within any file that would then apply those changes to each of the style templates.

This way, I have to amend each template... works 100% though! cheers

Our Sponsors
 

Brian
12-12-2004, 12:25 PM
Oh yea... I didn't think about the fact that the $styleid variable isn't globalized in the print_portal_output() function, so that's why it wasn't working properly. If you just add it to the list of global variables in that function then that should fix the problem. (I assume you know what I mean by that, but if not let me know and I can give you the specific code to find/replace).

theMusicMan
12-12-2004, 12:35 PM
I do understand what you imply there Brian, but I don't know where or how I would do this in vB. I looked in global.php but I don't think it is in there.

Please can you point me in the right direction. Thanks.

Brian
12-12-2004, 12:51 PM
forum/includes/vba_cmps_include_bottom.php

Just search that file for print_portal_output and then right below you'll see the global variables. Add $styleid to the list and that should take care of things. :)