Part of the EllisLab Network
pMachine Pro has been replaced by ExpressionEngine, our full featured web publishing solution. Please consider upgrading.
You can download pMachine Pro here: Download pMachine Pro  |  Download Language Packs
   
 
Help with dynamic menus using an include
Posted: 23 April 2005 08:52 PM   [ Ignore ]  
Summer Student
Total Posts:  4
Joined  2004-01-20

Im trying to set my site up to be dynamic in design.
Meaning, I would like to have one file for the menu, one file for the header, onefile for the footer and a “Template” that I could save as each new web page I create.  I have managed this to a certain extent using SSI such as this one for my MENU:

<!-- Calling Menu file //-->
<?php
require('framework/Menu.php');
?>
<!-- End Calling Menu file //-->

THe problem I am having is this. I want to have a folder hierarchy that is managable.
Base site = pmachine, the weblog.php lives there along with some other files.
mailinglist folder of the base folder some page files live there
framework of the base file for the require files and the templates and so fourth.
images= a folder off the main folder
and so on.

I have figured out how to address my menu items so they can be called from a page in any folder and work using the full path like so:

<p class="menuitems">
          <
a href="/pmachine/weblog.php" title="Jump to the main page">Home</a><br />
         <
a href="/pmachine/weblog.php?id=P7" title="Learn about A Still Small Voice">About Us</a><br />        
         <
a href="/pmachine/WhatsNew.php" title="Whats new at a Still Small Voice">Site News</a><br />        
         <
a href="/pmachine/Letter.php" title="Our On-Line content">The Word</a><br />
         <
a href="/pmachine/twocent.php" title="Share your thoughts">Your 2 Cents</a><br />
           <
a href="/pmachine/mailinglists/subscribe.php" title="Join one (or all) of the mailing list">Subscribe</a><br />            
         <
a href="/pmachine/archivesum.php" title="Search the Archives">Archives</a><br />        
         </
p>
        
<?php member_login_navbar(); ?>

but i cant seem to use this approach with my require statements.

<!-- Calling Header file //-->
<?php
require('/pmachine/framework/Header.php');
?>
<!-- End Calling Header file //-->

I would like to be able to embed these lines of code in my template and use them everywhere on my site without having to change code.

Any word on where I am missing it?

TIA

Profile
 
 
Posted: 23 April 2005 11:14 PM   [ Ignore ]   [ # 1 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9868
Joined  2002-06-19

You need to use the full server path to the file when you call them.  For instance, it could look something like:

require('/home/domain.com/http_docs/pmachine/framework/Header.php');

The exact server path will vary from server to server, so if you aren’t sure of it you can contact your Host/server admin to get it.

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 233, on December 18, 2007 12:04 AM
Total Registered Members: 64511 Total Logged-in Users: 0
Total Topics: 81069 Total Anonymous Users: 0
Total Replies: 436299 Total Guests: 19
Total Posts: 517368    
Members ( View Memberlist )
Active Members: