#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    33
    Rep Power
    1

    Help with navigation bar template


    OK, I know this is going to sound ridiculous but I am stuck and spent the last 3 hours trying to figure this one out and nothing yet.

    I have the most basic website file structure.

    I have my site root directory called: tenant
    I have a navigation bar with links to my other pages that are in my directory: tenant/pages

    I created a nice looking ccs3 navigation link bar template that I include at the top of each page with the php include function. this is working great. the problem that I have is my index(default page is in my root directory tenant and all my other pages are in the tenant/pages directory. I can go from index to any page no problem but once I am on a page that is sitting inside my tenant/pages directory I get errors.

    this is what I have so far

    <a href="../tenant/index.php">About</a>
    <a href="pages/login.php">Login</a>
    <a href="pages/register.php">Register</a>
    <a href="pages/private.php">Private</a>

    and it doesn't work. been at it for 3 hours and tried to get some help online but nobody seem to have the kind of directory structure that I have. everybody is showing an example of going back and forth from one page to another. but when you have multiple pages it doesn't work. can some one help? is it possible to make a navigation bar template or you have to make several templates for links that are outside a folder?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    33
    Rep Power
    1
    Originally Posted by jaad
    OK, I know this is going to sound ridiculous but I am stuck and spent the last 3 hours trying to figure this one out and nothing yet.

    I have the most basic website file structure.

    I have my site root directory called: tenant
    I have a navigation bar with links to my other pages that are in my directory: tenant/pages

    I created a nice looking ccs3 navigation link bar template that I include at the top of each page with the php include function. this is working great. the problem that I have is my index(default page is in my root directory tenant and all my other pages are in the tenant/pages directory. I can go from index to any page no problem but once I am on a page that is sitting inside my tenant/pages directory I get errors.

    this is what I have so far

    <a href="../tenant/index.php">About</a>
    <a href="pages/login.php">Login</a>
    <a href="pages/register.php">Register</a>
    <a href="pages/private.php">Private</a>

    and it doesn't work. been at it for 3 hours and tried to get some help online but nobody seem to have the kind of directory structure that I have. everybody is showing an example of going back and forth from one page to another. but when you have multiple pages it doesn't work. can some one help? is it possible to make a navigation bar template or you have to make several templates for links that are outside a folder?
    Ok I answered my own question. I made two different copy of my navigation template and this fixed the problem.
  4. #3
  5. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    Location
    A Land Down Under
    Posts
    2,117
    Rep Power
    1990
    If you want to do it the "right" way you've got three choices.

    1. Use complete URL's - http://www.mysite.com/pages.private.php
    2. Use a root-relative URL - /pages/private.php will take you to www.mysite.com/pages/private.php from any other page on the site
    3. Use some server-side scripting to automate where the links point to.
    The best way to do it is using option 1. That way there's no ambiguity, you always know exactly where a link is pointing to and it's very very easy to see.

IMN logo majestic logo threadwatch logo seochat tools logo