PDA

View Full Version : Drawing Breadcrumbs for Child Pages (manually)


socals
08-22-2004, 06:26 PM
I am creating custom pages, and child pages and I would like the breadcrumb to draw correctly, even if I have to manually add it to the pages.

Example:

+ Freeware Programs
-program 1 (page name is 'software')
-program 2
....

I would like the breadcrumb to look like:
Website Name > Freeware Programs
+- Program 1

To achieve this, I added code to vba_cmps_include_bottom.php:

if ($pages['name'] == 'software')
{
$navbits = array("?page=freeware" => "Freeware Programs","" => $pages['title']);
}
else
{
$navbits[''] = $pages['title'];
}


Since i'm new to vBulletin/PHP/CMPS, I would like to add the code the "correct" way.

If I modify the $navbits in my .php module, it seems to create a top nav of the forum, not the website.

By not touching the $navbits while in my custom page, the top nav breadcrumb is for the website (vbad modification), not the forum, which is what I want.

My modification draws the page exactly as I want it. I was wondering if there is a correct place for the code, or something I need to do different to have it create the top nav correctly from the original .php page?

I also wanted it to display the Software Name in the breadcrumb, not "Software". I did this by overwritting pages['title'] with the software name in my .php program. I tried using my own variable, but it didn't seem to retain the data. Not a global var or something?

da prez
08-23-2004, 02:55 PM
i believe you will have to write a query(s) to get info for undeclared variables.

assign the value of the query(s) upon return, to the variable of your choice.

Our Sponsors
 

socals
08-23-2004, 07:52 PM
After reading some PHP manuals, I am now using $GLOBALS['varname'] to pass variables.