Jump to content

Recommended Posts

Posted

Hi folks,

I read the great tutorials on PHP and thought I'd try using the header/footer-php-include technique to maybe make my pages smaller and more maintainable.

 

I created the site in question in dreamweaver with their template facility. As I was working on it with my homesite and wsftp and firebird tools these things came to mind:

 

1. Dreamweaver will be freaked out looking at only part of a page because it doesn't understand PHP includes. This means no more WYSIWYG.

 

2. To make a change I have to edit-upload-view to see a reasonable representation of what it will look like. Fast on DSL but still takes several seconds per edit.

 

3. There is no synchronization in WSFTP that I know of. I have to mark and upload every page I change.

 

4. Is this really worth the pain I am causing myself? Afterall, the header and footer are only 2k each, it doesn't affect the viewing audience because the post-server construction of the pieces is the same, and it could potentially make my life more diffecult if I want to make what would previously be a "quick change".

 

Does anyone have any thoughts on this? Am I doing something wrong? Am I missing a tool or big picture type of issue here? I am a programmer (C#, VB, etc) so coding web pages by hand is not foreign or difficult but I'm not much of a graphic guy so the WYSIWYG does help me do some layout throw-it-all-on-the-wall-and-see-what-sticks development.

 

Believe me, I'm NOT trying to start a WYSIWYG vs. hand coding conversation :D so please don't go there. I just want to make sure I'm not missing something that would make this method easier to use.

 

Thanks!

Posted

I recently came across a similar problem as my pages contain an inserted header and footer.

I designed a complete template page with the header and footer in and when I was completely happy I removed them into external files.

Posted

I think it comes down to how big your site is and how much you are going to change it.

 

I use Dreamweaver.

 

For a small site, I use the Dreamweaver templates. If I want to add a note on every page about something (for example there is a routine server upgrade or something) then I modify the template and upload the whole site.

 

If it's a big site, I don't want to do that, so I use php with headers and footers. Dreamweaver can copy fairly well with php. If you design things right then you can see in WYSIWYG the certral part of the page as you go. In my case, it doesn't have the style sheet included, so it's not quiet the same. I run a server and then php on my PC (I'm on a dial-up, so uploading to see the effect every time can be a pain). I do my main checks that way (you can also turn on full debugging for you PHP), and then a final check on the server by uploading.

 

I also use php because there are several other bits I want to do with a site as well as use php includes for headers and footers etc. Some are trivial, such as automatcially using my key words in title, META statements and Header - whcih helps search engine optimisation. Others are more complex, for example I like to prevent somone grabbing a copy of my site, for which I use php.

 

As to synchonise, I'm not sure about ws_FTP, I use the synchronise in dreamweeaver, which works fine.

 

Andy

Posted

I also use a server on my local machine for testing php stuff. After trying IIS and reading about Apache (only available on WindowsNT, I think), I came across Abyss Web Server. It's FREE, runs on Windows and Linux, and very easy to install and run. PHP is of course a free download, and again very easy to set up in Abyss.

Posted

Excellent advice btrfld,

 

I just installed Abyss and PHP without any hiccups and everything runs fine.

 

It was really easy to install and I can now view my SSI and PHP offline.

 

Thank you . . . much appreciated.

 

:D

Posted

My pleasure. I benefit so much from the family here, it's great to be able to contribute something occasionally. Dance

 

Jim

Posted

Ditto, thanks for the link. Great advice y'all, thanks!

 

Note: The use of the word "y'all", although appropriate due to my Kentucky upbringing, is used solely in this case as not to offend any females out there who may be put-off by "Great advice guys". :P

Posted

I haven't downloaded Abyss, but I will.

 

Even without Abyss, I find using PHP includes to be easy and time saving. In order for me to be able to see what's going on in Dreamweaver, I have a regular html file that represents my layout. When I'm happy with the layout, I copy the top part of the html file into my php header and the bottom part into my php footer file. I upload the two files and I'm done.

 

Since my site is over 10k pages, this saves me an incredible amount of time that no other solution could provide. But honestly, it's become so easy, that I use this same process on twenty and thirty page sites that I build for clients.

 

In my experience, when someone is just learning php includes, usually they don't put enough of the html into the header and footer files. I put everything except the actual content. And then there's always some neat behind-the-scenes php stuff going on in my header files.

 

So php is critical to my webdesign process.

Posted
In my experience, when someone is just learning php includes, usually they don't put enough of the html into the header and footer files. I put everything except the actual content.

This is where Dreamweaver templates actually help to do the PHP header/footer. In a normal DW page created from a template there are web page things, then a comment "Begin Editable" and another "End Editable". These make real good markers of where to cut a header/footer or content... content is just everything in between.

 

The only other case is when you have several editable regions - then you have to decide how to represent it.

 

I guess it just comes down to two things:

The disk space used by the header/footer being repeated on every page without PGP.

and

The amount of upload time sending just a header vs. every page.

 

<sigh> decisions, decisions.

Posted

It comes down to more than that.

 

When you have several dozen, or several hundred, or several thousand pages... there is no easier way that to use server side (php, cgi, ssi, asp, etc.) includes to make updates.

 

That's the real time saver... and I only repeat it because I don't think (from reading your posts) that you see the tremendous time saving advantages that others have pointed out.

 

I have a ten thousand plus page site. I can update the entire thing in less than sixty seconds and change the entire layout and design of the site. I'm on a dial up. The reason I'm able to do this is because I only change two files.

 

Templates in Dreamweaver is nice... but it's not the same.

 

And the time for the includes to load is nothing.

 

Right now, you are weighing the positives and negatives in your mind. This is the type of thing you can't really decide until you give it a try.

 

there will be a learning curve, but it's not steep.

Posted

Jack, I'm assuming that by splitting off 'head' and 'foot' areas, you also mean that opening and closing tags ({html}, {body}, ...) will be in different files. Yes? Maybe it's my obsessive nature, but the idea makes me nervous.

Posted

It works. I don't know what else to say... except that it's not necessary. You can use includes any way you want... or ignore it.

 

All I suggest is, try it... use it if you like it.

Posted

Hi,

 

I use SSI and includes all the time and yes dreamweaver never will show them all together, in fact I am glad it doesn't because dreamweavers WYSIWYG is actually not perfect

 

Yes I work with pages where my {head} is one include, {body} in other and all my end closing tags in a third, never bat an eyelid at it

 

Jim

Posted

As I stated earlier I installed Abyss and was very impressed I have however started to recieve this strange message:

 

Strange thing?

 

It looks like an add that's using windows messaging service.

 

I posted it here because it only started appearing since i installed Abyss and I've checked my proccess and can't see anyhting unusual.

 

I don't run any file sharing apps or the like and all thats active when it comes up is;

 

Abyss

Yahoo messenger

and

Sound fusion

 

Can anyone shed any light on this?

 

thanks

 

:)

Posted

Hi.

,

 

This is a piece of advertisment caused by spyware. Either the spyware is in the program you just downloaded or you have something a bit more sinster. Run a few of the free "ad-removal" scans over your system and delete anything they pick up, then see if it still occurs!

 

Jim

Posted

Digirunt, see my reply in your original thread about these messages.

Posted

If you want to use PHP includes and also use Dreamweaver for WYSIWYG editing, you need to upgrade to Dreamweaver MX. It ain't cheap, but it has native PHP capabilities and "understands" includes. You can't edit the included file from within the main file, but in the WYSIWYG mode you can see the included stuff.

Posted

Thanks! I didn't know that about MX. I'll have to check on the upgrade price because I do (obviously) own the previous version of DW, Fireworks and Flash.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...