Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Jul 2007
    Posts
    18
    Member #
    15547
    I want to base my site off a Dreamweaver Template (DWT) to make it easier to create new pages for all of the members who will be working on the site. To make things easier I would like to create a header.php and a footer.php file and use them as includes on the template to make things easier for myself. I've never done this before so I'm guessing the contents of the .dwt file would look something like this?

    Code:
    <?php include "/home/jonbarro/public_html/includes/header.php"; ?>
    
    <div id="content">
      <div>
        <h1><!-- TemplateBeginEditable name="Header" -->Header goes here<!-- TemplateEndEditable --></h1>
      </div>
      <div class="padding"><!-- TemplateBeginEditable name="Content" -->Content<!-- TemplateEndEditable --></div>
    </div>
    
    <?php include "/home/jonbarro/public_html/includes/footer.php"; ?>
    Am I missing anything from this code or can someone validate it for me and make sure it looks correct?

  2.  

  3. #2
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    The PHP is correct, although maybe the placement needs to be revised, where it says "Header goes here" perhaps header.php should be called there. and same for footer.

  4. #3
    Senior Member raspberryh's Avatar
    Join Date
    Aug 2004
    Location
    Erie, PA
    Posts
    882
    Member #
    7208
    Liked
    1 times
    Is it showing up in Dreamweaver (in Design view)? If I remember correctly, I would have all these weird problems with little things like whether I included the semicolon or not. So if DW doesn't seem to recognize that you've included the PHP files, try taking out the semicolon, using parenthesis, etc.
    choosy developers choose gif!
    website | paintings | blog

  5. #4
    Senior Member Shani's Avatar
    Join Date
    Nov 2004
    Posts
    1,140
    Member #
    8171
    I'm inclined to wonder why you need the .dwt any ways.

    Can't you have a template.php?

    PHP Code:
    <?php include('header.php');?>

    <title>Enter title here</title>
    <body>
    <div> Enter content here...
    etc.
    Shani

    I have an eye for detail like you'd never believe.

  6. #5
    Senior Member raspberryh's Avatar
    Join Date
    Aug 2004
    Location
    Erie, PA
    Posts
    882
    Member #
    7208
    Liked
    1 times
    Quote Originally Posted by DCScene
    I'm inclined to wonder why you need the .dwt any ways.
    ...Yeah I agree. It was always such a pain using DW templates b/c every time you make a change you have to update all the files and reupload every file that uses the template. Kind of defeats the purpose of even having templates :ermm:
    choosy developers choose gif!
    website | paintings | blog


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

dreamweaver include php in template

Click on a term to search for related topics.
All times are GMT -6. The time now is 12:18 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com