Archive: Dynamic, Section Specific Tabbed Navigation
AttentionThis post is an archived post. This means it is old or has been archived for rewriting in the near future. Please be aware that the contents of this article or page may be out of date. If you need assistance be sure to leave comments and our community can help you.
Adding Markets to the Links
Web parsers will use the last defined variable when a variable is defined multiple times, in ascending order. This means the latest definition of a variable will be used as its value. It's important to make sure any page-specific variables (such as the ones we'll be using) are defined before you include your configuration, functions or header file.
Always define variables. Any undefined variables can be manipulated in the address of your pages in the event a viewer figures out or learns which variable names you're using.
Setting Variables Depending on PageLet's assume your pages are called "index.php", "news.php", "about.php", "links.php". We need to add a small snippet of code to each of these pages that will tell our code when to classify a link as used. In order for this to work, though, you need to have the stylesheet and our pre-defined variables in a header file being included on each of these pages. Including is simple and allows easier editing of pages. If you haven't already, be sure to read up on how to dynamically include pages. Just in case, here's the include command we're using to include our header file, "header.php", that's in the main directoy of our server.
You must set the variable before you include the header file with the links in. Otherwise the links will not dynamically display because they're being parsed before we set our variables to bigger than zero. Any variables defined before an include to control page generation must always be defined before we include.