Copy link to clipboard
Copied
Hi, I have a question about website creation using Dreamweaver CC. So in this moment I'm developing a website using HTML in Dreamweaver. In this website there is a page called 'product', in this page there are some content such as image, description and specification. And the problem is I have to make about 30-50 product. It means I have to duplicate the product's html file and change the content 1 by 1.
I'm wondering, is there another way to make my job done easily? I mean I'm asking about something like an auto generate content. So what I should do is I just need to create 1 product page, and link it with some database file such as XML file or anything. In this XML there are exactly 3 column like the content in my page.
And the way it works is I just need to input data in an XML file and it'll auto generated HTML page with the content in my XML file, can I do that?
Thank you.
You could certainly use an XML file, but more typically a MySQL database would be used and PHP would be used to call the data.
It is normal these days for a website to have hundreds of "pages," yet really just a single "page" and all the content and layout variations are stored in a database or in files that can be pulled in as needed.
So you would have a database table called, maybe, items. You would define the product name, type, price, weight, photo, description, and whatever else is relevant i
...Copy link to clipboard
Copied
You could certainly use an XML file, but more typically a MySQL database would be used and PHP would be used to call the data.
It is normal these days for a website to have hundreds of "pages," yet really just a single "page" and all the content and layout variations are stored in a database or in files that can be pulled in as needed.
So you would have a database table called, maybe, items. You would define the product name, type, price, weight, photo, description, and whatever else is relevant in this table.
Then, on the website, you might have a page describing your product types, pages listing the items of a particular type (clothing, hardware, music, etc.) and then pages giving full product details.
You can even have your inventory managed in the database and when a product is sold out, it will automatically become unavailable on the website.
With such a website, without the database there would be no content in the website. No text and no photos. Just an empty shell.
To create such a site requires knowledge of PHP, but these days you can forego that expertise and use an off-the-shelf CMS like wordpress along with plug-ins that provide product descriptions and shopping cart experience.
Copy link to clipboard
Copied
If I want to use a XML and PHP to call the data, it means I should recrate the page using PHP instead of HTML page? And can you give me some ways or tutorial maybe, how to do that? Or the keywords? Maybe I'll search it by myself..
Copy link to clipboard
Copied
You can use an XML database to produce the page that you want. Have a look at XML Applications for basic methods and Google the subject for more complex applications.
Copy link to clipboard
Copied
The advantage of XML is that you would not have to install a webserver and database on your home computer in order to create your website, if you use AJAX, as in the example Ben provided a link for. You also might need to learn less with this method than with the PHP/database method, but I think that in all other ways the php/database method is superior.
For one thing, it is harder to debug javascript (AJAX) than php. That means that if something doesn't work right, it can be difficult to identify the problem. With the XML method, you would need some kind of tool to validate your XML because it would be hard to find errors in the XML simply by running the website.
With either method -- PHP/database or XML/AJAX, your links will contain the information needed to call the right data for the product. These are called url variables, or GET variables. They look like this:
mywebsite.com/product.html?product=5 (AJAX method)
mywebsite.com/product.php?product=5 (PHP method)
So in the example above, the link goes to the page product.html, which you want to be populated with the data for product number 5. The PHP code or the AJAX code takes that variable (5) and looks for a matching record in the XML document or the database.
You can use PHP with an XML document, but you would need to then install a webserver (like XAMPP).
Copy link to clipboard
Copied
Please forgive me, but with the W3Schools example I merely wanted to point out that XML can be used as can CSV and JSON.
However, like Rob and Nancy, I use PHP/MySQL.
Copy link to clipboard
Copied
Do not use static HTML to build separate pages. Before long your site will grow into a 10,000 lb gorilla that you will hate managing. Build your site dynamically with PHP & MySQL.
Do you plan to sell your products online? Then you need a shopping cart attached to your product database. Product Detail pages built in PHP are generated on the fly by your server with content stored in the MySQL database. In addition, you'll need a backend CRUD system (create, read, update, delete) to manage product data,
If you want off the shelf solutions, look at WebAssist & Cartweaver eCommerce extensions for Dreamweaver.
Adobe Dreamweaver Extensions for CS3 CS4 CS5 CS6 | WebAssist
Cartweaver The Shopping Cart software that lets you be in charge.
Nancy
Copy link to clipboard
Copied
So its impossible to use HTML?
Umm no I dont plan to sell it online, the website just show the product and if someone want to buy it, they have to call by phone.
Copy link to clipboard
Copied
So its impossible to use HTML?
Umm no I dont plan to sell it online, the website just show the product and if someone want to buy it, they have to call by phone.
HTML alone does not DO anything. It's merely a structure for displaying content. In order to perform functions, you need the addition of server-side (PHP) or client side (AJAX) scripts.
I don't know what your business model is or what you're trying to sell. But in my experience, people want instant gratification & the convenience of online ordering 24/7. Or at a minimum, a reliable way to contact you online when they have questions.
Nancy
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more