Jump to content
xisto Community
Lozbo

Dw Templates Vs Php Includes which one you prefer?

Recommended Posts

I dont usually work with templates. In fact i have never created one, but where i work they used to have dreamweaver templates, so i had to keep to it.Truth is i havent actually modified any, couse i like better working with php includes of content as menus, headers, footers and other kind of info within each page whos going to have that section, instead of having a dreamweaver template.I dont know if im making my self clear, but i dont know what would you have to say about it, which one you think its better? I mean, i know that they are different and that the main difference is that in order to use the includes, the server must support php...

Share this post


Link to post
Share on other sites

You are using templates even if you use includes man!!C'mon, html, css (it is PRESENTATION) has to be somewhere in the code. It does not matter if it is php or html. You must have something to look at! If you use includes, the code for look of includes in includes themself, and if you prefer clean html (no php) then the code in html determines the look of your site (and in css). If this answers your question, you still have a lot to learn, about web sites, and the concepts behind it (no hard feelings). And this is the right place to do just that!Ask away!

Share this post


Link to post
Share on other sites

You have never used dreamweaver templates ciroxyz. I prefer to use php Includes as it gives you alot more freedome. But dreamweaver treats includes as templates sometimes. And I think its you who needs to learn alot more (no hard feelings). My sites are clean html, with php. if you use php at all, it does not show for the end user, the php code is processed by php (the software) and the output is html. BUT you need to tell php what the outputs can be, so, all clean valid html :) and css of corse.

Share this post


Link to post
Share on other sites

Guess i didnot make my self clear, couse i was talking especifically of DREAMWEAVER templates, i understand that its another kind of "template" while working with css and php, so i asked if you were working better with dreamweaver built in templates or the other way around...Yes, i certanly need to learn a lot, i know nothing about nothing, i believe we all have always something to learn, as we do not born knowing, nor do we ever achieve total knowledge :):) hehe thanks cyroxyz, obiously no hard feelings, i apreciate help from people who knows better than me, and cheers. I have read some things and im still reading tutorials, and have a lot of stuff to documentate myself, and of course: there is always the good old web (and the forums beneath it:)).

Share this post


Link to post
Share on other sites

I think as people become more experienced with building websites they discover that Dreamweaver's not really the best tool for the job and start hand-coding all their sites, so for more experienced designers my guess would be that includes (whether it be PHP, ASP, SHTML or what) would be the favourite.

Share this post


Link to post
Share on other sites

and i think you would learn some xhtml and xml standard,and css.this standards will fit for all the browsers,then it haz a simple tag of the xhtml ,this would make simple beautiful pages.you would go hereoswd.orgmeans opensource web design

Share this post


Link to post
Share on other sites

i don't use neither, but i have an idea of how it works, and i think both are equal or something like that, please forgive me if i don't know of what i'm talking:*in one hand, nothing better than dynamical content, and i think php is the best way you can achieve it.*but, i'm not sure at all, that makes the search engines can't see the meta tags, and all about SEO.and that's way i think you could use it together.i'm new in web design, please if someone knows how to do it with php, please post me where to find that info, also with dw, thanks!

Share this post


Link to post
Share on other sites

*but, i'm not sure at all, that makes the search engines can't see the meta tags, and all about SEO.

183013[/snapback]

What do you mean? if you use dynamic content meta tags are invisible to search engines? As far as i know it does not matter, as server side coding (like php) renders itself in the server and runs on clients browser as normal html (or whatever you specify to print), so if you include for example a file named "meta.php" with all the meta tags defined in it (which i find myself cool) and then include it in each of your pages that need that given set of meta tags, it should be visible by all the search engine spiders, as its normal html what is displayed.

 

About the templates, i find it easier and more customisable working with php, but i could not say as im not and advanced user for dreamweaver templates, thats why i asked if any one knew...

Share this post


Link to post
Share on other sites

so if you include for example a file named "meta.php" with all the meta tags defined in it (which i find myself cool) and then include it in each of your pages that need  that given set of meta tags, it should be visible by all the search engine spiders, as its normal html what is displayed.

183168[/snapback]


I never thought of that...it's a really good idea!! Thanks a lot for it!! I'll be using it in all my websites soon.

Share this post


Link to post
Share on other sites

so if you include for example a file named "meta.php" with all the meta tags defined in it (which i find myself cool) and then include it in each of your pages that need  that given set of meta tags, it should be visible by all the search engine spiders, as its normal html what is displayed.

I usually create a header include which includes the doctype, title, head section (including meta tags), header & top navigation and the left side navigation too if applicable. Whack that in a function which can then be called from all your pages to dynamically change things like meta description and <title> tag.
I do the same with my footer.
So then, most of my pages look like this:

Header include
Individual page content
Footer include

Share this post


Link to post
Share on other sites

Whack that in a function which can then be called from all your pages to dynamically change things like meta description and <title> tag.

183395[/snapback]

How would you do that? dynamically change it?

 

I usually have my includes like header and menu on separate files, but i think that the way you work is easier... thanks for the tip.

Share this post


Link to post
Share on other sites

Well I usually work in ASP so not sure how it goes in PHP but a sub (sorry meant sub not function) in ASP works like this:

 

Sub WriteHeader(pageTitle,metaDescription)<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://forums.xisto.com/no_longer_exists/ xmlns="http://forums.xisto.com/no_longer_exists/; xml:lang="en" lang="en"><head><title><% = pageTitle %></title><meta name="description" content="<% = metaDescription%>" /></head> <body>end sub
Then on your page, do this:

 

<% WriteHeader "Your page title","Your meta description" %>
The bit in the quote marks in the call to the sub gets input into the sub which prints that and the rest of the HTML.

You also need an include on each page that contains the sub.

Share this post


Link to post
Share on other sites

PHP includes.Dreamweaver templates, last time i checked, used comments and stuff in normal HTML to define editable areas, and <!-- --> is very unpretty to say the least. (why couldn't they define // in HTML?)Also, with dreamweaver templates, the disadvantage is this : you need dreamweaver. PHP is free, whereas dreamweaver is expensive and not everyone has it - though if you've already paid for it, this is kind of a moot point.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.