Closed Thread Icon

Topic awaiting preservation: PHP templates ? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12806" title="Pages that link to Topic awaiting preservation: PHP templates ? (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: PHP templates ? <span class="small">(Page 1 of 1)</span>\

 
Moon Shadow
Paranoid (IV) Inmate

From: Rouen, France
Insane since: Jan 2003

posted posted 07-03-2003 10:50

Well, I must say I'm quite new to PHP, and I wondered about a few things.

On my website, I previously used templates made with Dreamweaver MX. It worked perfectly fine. However, now I'm beginning to include PHP on my website. I already put a large PHP code in my template for a RSS parser in my menu (just a temporary place). As I intend to put more and more PHP on m website, I was wondering : is it better to keep my existing template, or switch to PHP templates and include my menu etc ?

Oh, and another question : does the use of "include" slows down the download of a webpage ?

Edit : spelling.



[This message has been edited by Moon Shadow (edited 07-03-2003).]

[This message has been edited by Moon Shadow (edited 07-03-2003).]

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 07-03-2003 14:24

a) if you got working dreamweaver templates, and don't want to edit your site outside of dreamweaver, and have enough space at your webhost, stay with the dream weaver ones.
Since I believe they're processed when you save the pages (or ftp them up, I'm don'kt know), they'll always be delivered faster to your user than php included templates.

b) yes includes slow the creation of your page on the server. But usually not enough to worry about.

Moon Shadow
Paranoid (IV) Inmate

From: Rouen, France
Insane since: Jan 2003

posted posted 07-03-2003 16:59

Understood TP, I shall keep my templates. Thanks

(And templates are processed when saving the mainf template, yes )

Lurch
Paranoid (IV) Inmate

From: Behind the Wheel
Insane since: Jan 2002

posted posted 07-04-2003 10:12

I may have read it wrong, but I disagree...

I used to use DW templates for my sites - still do if i have to do a site for a client who already has a host that doesn't have php. The templates are a great leap over having to change every page on the site when you want to change the menu or something, but php templates are even better. With the DW templates, it'll update all of the templated pages automatically, but then you have to upload every page! that's a lot of uploading.

In PHP, I usually use files called top.php and bottom.php - they have my header and footer html (title, menus, copyright info, etc..) and wrap them around each page with include()... that way when I update either of those files, I just have to upload once.

The include() will add fractions of a second to the process time... certainly not worth worrying about.


Moon Shadow
Paranoid (IV) Inmate

From: Rouen, France
Insane since: Jan 2003

posted posted 07-04-2003 12:25

I mixed both anyway.

I kept my Dreamweaver templates for the head, header, and for the main layout. And I only included in my template specific parts of my webpages such as my menu (and soon a shoutbox).

Of course I need to re-upload all the files based on the template, but uploading time is not anymore a worry in our broadband world, right ?

Suho1004
Maniac (V) Inmate

From: Seoul, Korea
Insane since: Apr 2002

posted posted 07-04-2003 15:47

Just to offer a different take on the whole PHP idea, here's how I do my site: unlike Lurch, my PHP template is my file and I include the content in that. Of course, this requires fiddling with .htaccess to direct all requests to this template, but I really like the way it works. If you ever think about doing it this way, I'll be willing to share any ideas or code with you if you'd like.

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 07-04-2003 18:31

well, depending on the traffic on your site, lurch might be right.
Ie. if it doesn't get much traffic, and your site is fairly large (strange, isnt' it),
the php templates might be the more efficent solution.

(but then, moonshadow'd have to redo his/her templates. and that's gotta be more work than it's worth,
afterall, uploading is a fully automated process)

Lurch
Paranoid (IV) Inmate

From: Behind the Wheel
Insane since: Jan 2002

posted posted 07-04-2003 19:44

True.. I'm on 28.8 dial-up for the summer though, so I tend to think more uploads is bad


jive
Paranoid (IV) Inmate

From: Greenville, SC, USA
Insane since: Jan 2002

posted posted 07-04-2003 22:02

There is support in dreamweaver mx for php templates as well. The application panel on dwmx is a awsome discovery once you start using it. For now, I'm learning PHP and I hand code everything while I'm learning. (will do so for about a year or so) Than back to dwmx. Macromedia has some great articles for hooking you up on php and dwmx.



Moon Shadow
Paranoid (IV) Inmate

From: Rouen, France
Insane since: Jan 2003

posted posted 07-05-2003 11:38

Well my site is not that large, and doesn't have that much much visitors, but a fair amount nonetheless for a website under construction. I hit 10000 hits yesterday, the domaine was up since 3 months.

Jive, what do you mean by the support of PHP templates in Dreamweaver MX ? If there is something I missed, I want to know what it is

Well, finally I mixed both Dreamweaver and PHP templates... It looks like this for example :

code:
<tr> 
<td style="vertical-align: top; width: 125px;"> <? include ("pages/menu.php") ?></td>
<!-- TemplateBeginEditable name="body" -->
<td style="vertical-align: top;">

[i]Here I put the code specific to each page.[/i]

</td>
<!-- TemplateEndEditable -->
<td style="vertical-align: top; width: 125px;"><? include ("shoutbox/shoutbox.php") ?></td>
</tr>



I thought it was the easier way to code for me to update quickly the website. Is it ok ?

[This message has been edited by Moon Shadow (edited 07-05-2003).]

marf
Bipolar (III) Inmate

From: Canada
Insane since: Oct 2001

posted posted 07-05-2003 17:00

When i try to use that <? include('main.php') ?> in my website it gives me this error


Warning: Failed opening 'leftbar.php' for inclusion (include_path='c:\php4\pear') in C:\Program Files\Apache Group\Apache2\htdocs\sitecontent\page.php on line 29


any help?

marf
Bipolar (III) Inmate

From: Canada
Insane since: Oct 2001

posted posted 07-05-2003 17:02

NM.. I fixed it

Stupid me

« BackwardsOnwards »

Show Forum Drop Down Menu