PDA

View Full Version : Custom Tab Not Selected


DRJ
07-24-2013, 02:46 AM
I am trying to add a custom tab to the navbar. I have it added but it won't show as selected, the Forum shows as selected. Looking through posts I got it all setup but must be missing something.

The file is portal.php


<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################

define('THIS_SCRIPT', 'portal');
define('CSRF_PROTECTION', true);
// change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array();

// pre-cache templates used by all actions
$globaltemplates = array('portal',
);

// pre-cache templates used by specific actions
$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
// if your page is outside of your normal vb forums directory, you should change directories by uncommenting the next line
// chdir ('/path/to/your/forums');
require_once('./global.php');

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################

$navbits = construct_navbits(array('' => 'portal'));
$navbar = render_navbar_template($navbits);

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'Portal';

// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######

$templater = vB_Template::create('portal');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
print_output($templater->render());

?>


The file is in the forum directory.

For Target URL I have this: portal.php{session.sessionurl_q}

For Tab Scripts I have: THIS_SCRIPT

Not sure what I am missing.

Thanks

--------------- Added 1374638258 at 1374638258 ---------------

I figured it out. I needed to set this to yes:

Append 'tabid' to URL

Lynne
07-24-2013, 04:58 PM
Or put 'portal' where it says Tab Script(s)

DRJ
07-25-2013, 10:55 PM
Even better. Thanks :)