Unique Page Content

After a few days of business meetings we’ve finally managed to get the page content online into the new site. This is where osCommerce falls down in my opinion. When I first looked at osCommerce I was slightly puzzled about how to update site content and then after rereading the front page on the default installation I realised that you had to physically open the language files and update the text in there, then of course FTP it to your server - which of course most normal (ie. non web design/developer people) have any knowledge of. Yet these are the people who are commissioning us to set their sites up.

One of my clients asked me to set up a links page and a customer’s testimonials page for her, and set it up so she could add to it. Rather than making her have to trawl through the pages themselves I’ve set up a couple of simple text files using basic code such as paragraph tags, bold (strong) tags etc. For the links I’ve had her list them out in a consistent way and then I use PHP to retrieve the link and text and then link it all in a specific way. However to update these files she has to do them directly online via cPanel (as she didn’t have a clue when I mentioned FTP!). This is of course a major inconvenience to both my client and plenty of other people out there who are not used to trawling through code to find where to update the page text, let alone adding HTML markup!

Anyhow, for us it’s straightforward. A couple of tips I do have when adding page content and creating new pages as well is to also ensure each page has a unique title and uses heading tags and good markup. Whilst the bulk of osCommerce markup is pretty heavy going and tables upon tables, if the content you can easily change and control is as good as possible then you’ve given yourself a little edge you may not have had otherwise.

So what to do? To update the default informational pages and to create further ones (simply copy say the about_us.php file and save it with a new filename), open up one of the files eg. about_us.php. Now the most important part of a web page is the page title, and osCommerce doesn’t really go in for unqiue titles per page (unfortunately), however there’s an easy way around this. On the page go down to the title tag where you’ll see

<title><?php echo TITLE; ?></title>

The TITLE being printed out is the standard title set in the language file, usually the name of your company or store. Of course we should still keep this in the title to give the site consistency and make it clear to visitors which site they’re on. So to edit this simply add in some unique content, a good key phrase that relates to the page before the PHP statement eg.

<title>About Joe Bloggs and Sons, Suppliers of Fine Wines to the UK | <?php echo TITLE; ?></title>

For example…! Okay I appreciate that most pages can’t have a good title but something more than just the store name will be an improvement.

As for your page content, in the PHP page scroll a bit further down you’ll find the page heading ‘About Us’. This will usually be found looking similar to

<td class="pageHeading">About Us</td>

Put this into a header tag. Headers are considered more important on a page than bog standard page text which is what the above is considered as. So to change this simply do the following:

<td><h1 class="pageHeading">About Us</h1></td>

So the header is still in the table cell, and using the same CSS class but is now wrapped by a header tag as well, giving it more importance on the page. Of course with your own text if you feel you can warrant a second heading, use a h2 tag to wrap this header.

I’ll go into detail how to get a unique title for each category and product page another time. It’s a touch more complicated with hacking the PHP, but the results are great for your site!

Leave a Reply