How to make a framed site with sidebars?

quickie34

New Member
:DOk This is probably basic stuff :D

I want to make a main design frame to use for the whole website. I dont want to have to make a separate page with sidebars, headers and all that for every page, So thats why I want frames. I dont want iFrame because it wont change size depending on what´s inside of it.

But when I tried this configuration made in dreamweaver the left black sidebard showed fine in dreamweaver but when I uploaded to the server and viewed in safari the left black frame was gone and the green one had moved to left and was now going from top to bottom.....

If someone could make me a browser safe html-structure for this I would be delighted :D
 

quickie34

New Member
Below is the structure I am trying to get with regular frames in Dreamweaver cs4
 

Attachments

  • webdesign.jpg
    webdesign.jpg
    78 KB · Views: 70

JordanT

New Member
Have you considered using PHP includes instead of frames?

Frames, in my opinion, are outdated in a lot of cases - especially in regard to what it seems you're trying to achieve.

Have a look at this tutorial for Includes http://www.tizag.com/phpT/include.php

If you need to take a step back from that, have a look at the Introduction to PHP : http://www.tizag.com/phpT/index.php

Check it out and let me know if you have any questions. I think this could be a much cleaner way to get the results you're after.
 

JordanT

New Member
Further to my post above I thought I would give you the general idea on how these includes work.

Say you were to create your home page, call it index.php - this is what it may look like... (Note that it will need to have the .php extension for the PHP Includes to work - You will need to see if your server supports this, though most do.)


Code:
<html>
	<head>
		<title>Testing PHP Includes</title>
	</head>
	
	<body>

		<?php require('header.php'); ?>

		<?php require('sidebar.php'); ?>

		Main content goes here...

	</body>
</html>

If you've never worked with PHP before the only part of the above you may be unfamiliar with is the code inside the <?php - ?> tags.

Very basically this will call the files you've asked for (header.php and sidebar.php). The PHP will insert these external pages in to your index.php in the exact position you've placed the PHP code.

With this in mind you'll need to also create header.php and sidebar.php and, in them, create the HTML for you pages.

Keep in mind that, because this inserts the external pages EXACTLY where you've placed the PHP code, you will need to use either CSS (recomeded) or tables to structure your page.

Once you've mastered this you can create another page, about.php for example, and use the sample includes to grab the header and the sidebar again.

In future if you need to make changes to the header you just edit the header.php file.

I've gotta head out now but if you have any questions post a reply and I'll get back to you when I have a little more time.
 

quickie34

New Member
Thank You, I´ll look into this
I have not worked with PhP earlier except from editing various already made scripts for guestbooks etc...
Would be nice though if dreamweaver were a bit compatible with this so that pages wont get screwed up when entering that editor. Well.. I´ll test it shortly. I guess my server support it.:)

Further to my post above I thought I would give you the general idea on how these includes work.

Say you were to create your home page, call it index.php - this is what it may look like... (Note that it will need to have the .php extension for the PHP Includes to work - You will need to see if your server supports this, though most do.)


Code:
<html>
	<head>
		<title>Testing PHP Includes</title>
	</head>
	
	<body>

		<?php require('header.php'); ?>

		<?php require('sidebar.php'); ?>

		Main content goes here...

	</body>
</html>

If you've never worked with PHP before the only part of the above you may be unfamiliar with is the code inside the <?php - ?> tags.

Very basically this will call the files you've asked for (header.php and sidebar.php). The PHP will insert these external pages in to your index.php in the exact position you've placed the PHP code.

With this in mind you'll need to also create header.php and sidebar.php and, in them, create the HTML for you pages.

Keep in mind that, because this inserts the external pages EXACTLY where you've placed the PHP code, you will need to use either CSS (recomeded) or tables to structure your page.

Once you've mastered this you can create another page, about.php for example, and use the sample includes to grab the header and the sidebar again.

In future if you need to make changes to the header you just edit the header.php file.

I've gotta head out now but if you have any questions post a reply and I'll get back to you when I have a little more time.
 

quickie34

New Member
Strange by the way (maybe) that Dreamweaver doesnt have templates for php-structures but a lot on regular frames
 

JordanT

New Member
Strange by the way (maybe) that Dreamweaver doesnt have templates for php-structures but a lot on regular frames

I believe the more recent versions of Dreamweaver have fairly good PHP support, ie; includes showing up in the Design View, but it's still far from perfect.
 

constanthosting

New Member
I would propose to use php includes also, It's not terribly difficult. For example, If you wanted the same menu on every page, but don't want to have to edit every page directly you would insert something like this where you want the menu at,

<?php include("menu.php"); ?>


and then create a seperate menu.php file with your menu structure in it. then you only have to edit menu.php

You will have to adjust all your pages from an htm/html extension to php. This won't affect any of your html code.. it will just enable it to run php
 

LouTheDesigner

New Member
I believe the more recent versions of Dreamweaver have fairly good PHP support, ie; includes showing up in the Design View, but it's still far from perfect.

Very true. They should add it to the behaviors panel, which adds javascript for you. It would be great to apply a mailto function to a button in the behaviors panel.
 

wetgravy

New Member
I work with php design almost daily, and dreamweaver rarely shows it accurately. most of the time i'm constantly uploading to my test server to see the correct view of websites. Sucks, but it's part of the pains of building design for php.

As for the frames, do avoid them. a little php loading will go a long way when it comes to designing parts of pages seperately.
 

PixelPusher

Super Moderator
Staff member
Another plus side to using php is that it allows for so many more options if your needs grow it the future, where as the frames are, well frames, and that's it. Php is definitely the better choice.
 
when you assign a value to a property in the Default Layout section, it applies to all the pages in the site. If you want to make an exception for the Main Page, for example, you edit the same property in the Main Page section and assign it a different value. This arrangement provides the convenience of setting a value in one place with the flexibility of specifying different values for different pages.
 
Top