HighDots Forums  

Includes Within Includes

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Includes Within Includes in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
David B
 
Posts: n/a

Default Includes Within Includes - 05-25-2004 , 10:28 PM






I'm now able to make and display MySQL tables, using PHP, and I'm
playing with all kinds of ideas for streamlining my websites.

Let's use a 50-states site as an example. Rather than create 50 web
pages - one for each state - and pasting an article about each state on
each page, I'm thinking of writing 50 articles and putting them in a
database. I'll still have 50 web pages, but each page will simply
include a PHP function that fetches the appropriate article.

But I'm thinking of taking it one step further. At present, each page
looks something like this:

<head>
</head>
<body>
<div class="body2">
<div class="body3">
[PHP INCLUDE FOR TOP SECTION]
<table class="tabmain">
<tr>
<td class="tdleft"></td>
<td class="tdcenter">[PHP INCLUDE FOR ARTICLE]</td>
<td class="tdright"></td>
</tr>
</table>
[PHP INCLUDED FOOTER]
</div>
</div>
</body>

What I'm now thinking of doing is putting EVERYTHING between the body
tags in an include, so the page would look like this:

<head>
</head>
<body>
[ONE BIG PHP INCLUDE]
</body>

.... and the included page would look like this:

<div class="body2">
<div class="body3">
[PHP INCLUDE FOR TOP SECTION]
<table class="tabmain">
<tr>
<td class="tdleft"></td>
<td class="tdcenter">[PHP INCLUDE FOR ARTICLE]</td>
<td class="tdright"></td>
</tr>
</table>
[PHP INCLUDED FOOTER]
</div>
</div>

Is this a good plan, and what would the includes in the included page
look like - just like regular includes?

At present, my includes look like this:

<?php include ($seg."a1/inc/toptopics.php"); ?>

where $seg represents the relative distance to the site's home page,
like ../ or ../../

I might be able to build the top section and footer into the body
section, so I wouldn't need to include them. However, I'd like to retain
a little flexiblity, in case I need different page structures for
certain sections of my site. Or maybe I'll just make three or four
master pages that include everything - top section, main table and
footer. But I'd still have to include the articles.

Any tips?

Thanks.

Reply With Quote
  #2  
Old   
Julian Roberts
 
Posts: n/a

Default Re: Includes Within Includes - 05-26-2004 , 08:05 AM






You ought to take one step further and show it all on one page.

--
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.