Web devs, guide me in the proper direction

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Here's the thing. I want to make a PHP site just so I can retain a common theme across a multitude of pages. The pages 'include'd by the PHP file will contain the whole page except the menu bar, the heading info, the link styles, and what not.

The content pages will of course have HTML tags in them and everything, including tables/links/etc.

I just want the PHP to serve as the "base" of the site, providing the menu bar and color theme. A very, very primitive CMS, I suppose.

I'd like to be able to edit the content pages in a way such that I could see the end result without having to request the PHP file from a web server. That's where the problem comes in. All the color scheme and style info will be missing, and I will have no idea how the content is going to end up looking. I was hoping to edit my content in DreamWeaver and I was wondering if it had any feature where it could insert the styles from elsewhere while you edit your content?

Is there a better way to approach this? Please enlighten me.
 

Furor

Golden Member
Mar 31, 2001
1,895
0
0
Why don't you install php on your local computer so you can browse the site locally, without a webserver?
 

troytime

Golden Member
Jan 3, 2006
1,996
1
0
are you only using the php to do the actual file include?
If so, you can use SSI, dreamweaver will display SSI includes as long as the site and directories are set up properly.

If you're actually using more of php capabilities, you could set up apache and php on your dev box (or even run xampp if you're only working with one site)

 

Alex

Diamond Member
Oct 26, 1999
6,995
0
0
Originally posted by: George P Burdell
Originally posted by: troytime
run xampp

Thats the way to go if you don't wanna install Apache and MySQL.

its the best way to go... just install it and you have a full-fledged testing webserver including filezilla and mercurymail

as far as editing styles and dreamweaver go its the best option
use CSS files to create a general site style (its easy to do with DW) and then just apply it to every page in your site.
 

TeamZero

Senior member
Apr 14, 2004
519
0
0
(disclaimer: if I understand you correctly)

To do what you're describing..no, you don't need SQL of any sort.

I recently made an application just like this, each page would like this

<?php
include("header.php"); // This would be the top portion of your HTML document, including the head and CSS information
include("navigation.php"); //Obviously your navigation, easy to change if you need to change it, just edit one file.

echo("
<!-- page specific HTML here -->
");

include("footer.php");
?>



The includes are just predefined php files with your data in them, for instance here is a sample footer:


<?php
echo("<tr> <td colspan='2'> <center> Copyright MyPage 2007 </td></tr> </table>");
?>



Edit: bah, no code formatting in this forum software :(


 

troytime

Golden Member
Jan 3, 2006
1,996
1
0
Originally posted by: TeamZero
(disclaimer: if I understand you correctly)

To do what you're describing..no, you don't need SQL of any sort.

I recently made an application just like this, each page would like this

Code:
<?php
include("header.php");  // This would be the top portion of your HTML document, including the head and CSS information
include("navigation.php"); //Obviously your navigation, easy to change if you need to change it, just edit one file.

echo("
<!-- page specific HTML here -->
");

include("footer.php");
?>

The includes are just predefined php files with your data in them, for instance here is a sample footer:

Code:
<?php 
echo("<tr>  <td colspan='2'> <center> Copyright MyPage 2007 </td></tr> </table>");
?>

why echo html?
just break out of php
?>
<b>Your html and content here</b>
<?
// more php code
?>

 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Originally posted by: Furor
Why don't you install php on your local computer so you can browse the site locally, without a webserver?

I want to be able to edit the final product WYSIWYG/realtime yet retain the structure I defined in the OP.

Originally posted by: troytime
are you only using the php to do the actual file include?
If so, you can use SSI, dreamweaver will display SSI includes as long as the site and directories are set up properly.

If you're actually using more of php capabilities, you could set up apache and php on your dev box (or even run xampp if you're only working with one site)

Interesting. I'm not sure what SSI is exactly but 'server side includes' sounds exactly like what I'm trying to do--nothing more, nothing less. If Dreamweaver can do that I may stick with that.

All I'd want to do is tell Dreamweaver to display code that isn't actually in the HTML page, or that is commented out somehow, because the browser won't be seeing any heading code in my raw content pages.
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,838
4,817
75
*cough*SSI*cough*

It'll only work if your web server is set up for it. (If you're the admin, there should be no problem.)

As far as Dreamweaver goes, I've never used it, but I've definitely seen it used where some sort of template was set up, and pages were developed based off that. It seems like exactly what you want. I've just been too cheap to buy it and find out.
 

sumguy1

Member
May 23, 2007
86
0
0
Originally posted by: xtknight
Originally posted by: Furor
Why don't you install php on your local computer so you can browse the site locally, without a webserver?

I want to be able to edit the final product WYSIWYG/realtime yet retain the structure I defined in the OP.

Originally posted by: troytime
are you only using the php to do the actual file include?
If so, you can use SSI, dreamweaver will display SSI includes as long as the site and directories are set up properly.

If you're actually using more of php capabilities, you could set up apache and php on your dev box (or even run xampp if you're only working with one site)

Interesting. I'm not sure what SSI is exactly but 'server side includes' sounds exactly like what I'm trying to do--nothing more, nothing less. If Dreamweaver can do that I may stick with that.

All I'd want to do is tell Dreamweaver to display code that isn't actually in the HTML page, or that is commented out somehow, because the browser won't be seeing any heading code in my raw content pages.

I'll say you're on the right track with your approach of externalizing commonly repeated style, navigation, and layout elements into their own separate files. And if that's all your trying to do and you don't need any additional processing logic on the server side to display dynamic content or anything like that, then I'll toss in my vote for server side includes as well. Any good web server (Apache included) should support server side includes provided that you just make sure it is enabled on the server configuration with no other 3rd party "plugins" or application/scripting language extensions necessary. It is such a simple notation that even plain html editors can support it and know how to interpret the SSI notation so to that end I'm pretty sure Dreamweaver supports ssi too. You just lose some of the flexibility of being able to do "dynamic includes" using application logic like you could do in PHP or some other server side scripting/programming language. Like, for example, with PHP logic you could include different "themes" for look and feel based on user preference settings.