Website design XML? PHP?

epoclaen

Member
Messages
79
Reaction score
0
Points
6
I have a website that looks and works fine with HTML and CSS style sheets with javascript coding. The problem I have is that just because it looks okay doesn't mean that the approach I'm using to generate the content is ideal.

I've been familiar with HTML for over a decade now and have mucked about with ASP and PHP and a little CGI on and off for the past 5 years or so. I've recently been reading more and more about XML, Ajax, and dynamic content. I expected to use PHP to set up header and footer include files but now I'm not so sure about such an approach.

My website will include weekly news updates as well as occasional additions to the main menu as I start new projects. I expect very few visitors since it caters to a small specific community of some 300 or so customers so server strain shouldn't be an issue.

So my question is, what technologies would be ideal to use in redesigning the website?
1. I had planned on using PHP include files for the header and footer in order to make a centralized routine for the menu as well as consistency between pages.
2. I'm now wondering if using XML files to generate content is the better way to go since the header and footer wouldn't need to be reloaded for each page. (At least I think this is correct from what I've been reading.)
3. If using XML files, how wise is it to use these for an entire page's content given that each page might have a very different layout?
4. Why muck about with separate XML files when it's easier to include the content directly on the pages where I can edit the layout and content all in one file?

I might just be confusing myself but I'd like input on the use of one technology over the others or on any other website design options that would work for what I have in mind.

Jeff
 

mitamata

New Member
Messages
81
Reaction score
0
Points
0
I think your decision depends on how often you change the content of your site. I'm guessing it's not very often, so perhaps xml is enough for you. If you're only going to change one page with the weekly updates, maybe it's not worth the time it would take to redesign it.
I've never worked with anything other than PHP to tell the truth, but I'd definitely recommend it if you intend to change content on a regular basis. We use it at work on a few projects and I'm finding it amazingly useful.
Also, if you decide to try it, look into smarty template engine. It lets you keep php code in one file and the html in another one. Makes the code SO much easier to write/manage :) I'd probably dislike php with a passion if it weren't for smarty.
 

knightcon

New Member
Messages
69
Reaction score
0
Points
0
I'll just let you know from the start it is a bad idea to make the main part of your site reliant on AJAX as if the users browser doesn't support it then your up a certain creek without a certain paddle :biggrin:. AJAX is a very good technology to use if you need a highly interactive application written for the web such as a chatroom (to name one). If you would like to use XML then I would recommend just using an XML stylesheet and then you can do something like using PHP to build the page and just include the external XML file. If you really would like to use AJAX then it would be a good idea to setup your site so that if the user's browser doesn't support AJAX the pages can just be included using manual methods from the server. Both of these methods aren't server intensive and should give your site visitors plenty of functionality and preference for one or the other.
 

Jesse

Active Member
Messages
1,360
Reaction score
0
Points
36
It Depends on you. But i suggest you use PHP Coding. It is more powerful.
 

VPmase

New Member
Messages
914
Reaction score
0
Points
0
I think xml is just for organizing data where as PHP is more interactive with the user and you can use MySQL to have a user system or comment system.
 

epoclaen

Member
Messages
79
Reaction score
0
Points
6
This website should have the potential to grown into something much more. It's possible that in the future I might even want to use a database with it. I think the thing that I can't wrap my head around is the question of, "why use XML for content management when I have access to PHP and a MySQL database which can retrieve, sort, and format whatever pieces of data I want AND ensures cross-browser compatibility?"

Ajax technology -
Likely not particularly useful in this situation. It's something I'd like to learn but not ideal for use in this situation.

PHP -
At this point I have no real need for any PHP code within the website content itself. The key feature of PHP would be an easy .include file mainly just for the header. My header image is a bit big for my tastes so would an .include file be cached using PHP this way?

One definite benefit would be that I only need one version of my menu bar. In the current setup I have to reload the menu bar for every page which means the links inside the menu bar need to be absolute (versus relative) links which I don't like given that the entire site will be moved to a new server someday soon and all of those will have to be changed.

The only downside is that I'd be restricted to using a server that supports PHP scripting.

XML -
@knightcon: I'm still rather new to using XML so why use an external XML stylesheet rather than just using an external CSS stylesheet? What do I gain from that?

Templates -
I tried building a template using one of my webpages in Dreamweaver and it had trouble picking out content blocks and pretty much failed to setup my layout the way I wanted it so I was a bit turned off by the concept from the get-go. @mitamata: Smarty looked interesting but also would mean I'd have to learn Smarty's tools and syntax for the design side of it. The idea of cleaning up all the <?php ?> tag bloating is tempting though! Maybe I'll toy more with Dreamweaver's template system a bit.

A lot of what I'm looking at involves keeping the website expandable. I do the same thing with my computer system when deciding which CPU, motherboard, and ports are best for my budget while keeping the system upgradeable down the line.

Jeff
 

nahsorhseda

Member
Messages
116
Reaction score
0
Points
16
i suppose xml is not a good option there are lot of things about xml which r still not clear n getting help over those matters is still worse
 
Top