Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Web Design & Development
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory modem monitor motherboard mouse network printer problem ram registry repair router slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: Menu Bar

Reply  
Thread Tools
_Nessa_'s Avatar
Computer Specs
Member with 55 posts.
 
Join Date: Sep 2009
Experience: Intermediate
14-Nov-2009, 11:30 AM #1
Solved: Menu Bar
So I have a nice little menu bar for each one of my pages. Isn't there a way I can attach it like a style sheet to each one of my pages so that if I want to modify/add a link I only have to do it once?

I'm quite sure I've actually done this before but I don't remember how I did it .

...

Or if I could maybe create a template? Each page of the site (excluding the main page) is the same format with different text/etc.

(apologies, my brain has not woken up yet)
namenotfound's Avatar
Computer Specs
Senior Member with 3,003 posts.
 
Join Date: Apr 2005
Location: New York
Experience: no man can be my equal
14-Nov-2009, 11:26 PM #2
http://www.smarty.net/

Smarty is a template engine written in PHP, which can make every page have the same layout and style.
colinsp's Avatar
Computer Specs
Senior Member with 1,044 posts.
 
Join Date: Sep 2007
Location: Spain
Experience: Adv PC, int HTML, bit PHP
15-Nov-2009, 02:47 AM #3
Just save the code that makes the menu bar as menu.php (you don't have to alter the html at all) then wherever you want it on a page just include it with
Code:
<?php 
 include 'menu.php';
 ?>
And save this new page with a php extension such as index.php.

That's it there is no need to template it if you don't want to.

This is an example of one of my menu.php files
Code:
<div class="topnav" id="nav">
    <ul>
      <li><a href="/index.php">Home</a></li>
      <li><a href="/about.php">About Us</a></li>
      <li><a href="/groups.php">Groups</a></li>
      <li><a href="/membership.html">Membership</a></li>
      <li><a href="/committee.php">Committee</a></li>
      <li><a href="/links.php">Links</a></li>
      <li><a href="/newsletter.php">Newsletter</a></li>
      </ul>
  </div>
_Nessa_'s Avatar
Computer Specs
Member with 55 posts.
 
Join Date: Sep 2009
Experience: Intermediate
15-Nov-2009, 11:12 PM #4
Thank you! I knew there was a simple way to do it
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 12:54 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.