|
SEO - Thinking Like a Search Engine |
|
|
|
|
There are volumes of information available for search engine optimization (SEO) techniques available. From forums, to books, to classes, and to general advice simply floating around. Terms such as white hat and black hat techniques, are often discussed as in the right way, or the fair way, or the way to gain a unique advantage. We often hear about link exchange, meta tags, and various other activities which may be part of an effective SEO strategy.
However before digging into the mechanics of what may or may not work to get your site at the top of the search engine results food chain, take a moment to step back and ponder this idea, what are the goals of the search engines themselves? They do have them you know, the search engines are not out there out of the goodness of their hearts. All of the major search engines, Google, Yahoo!, and MSN, exist for one thing, to turn a profit for their owners and maintainers.
And how do they turn a profit? The same way that any other enterprise on the Internet does, the same reason you are likely interested in SEO in the first place, by driving traffic to their sites. What is the number one thing that will make a particular search engine popular with magnitudes of traffic? By ensuring the search results they provide are as accurate and complete as possible. To ensure the sites that display at the top of those results contain the very information you are searching for. When this is a achieved, your search provides useful results, more than likely you are going to the same place for your next search, and on and on. It is the primary reason Google is the most successful search engine today, and when it fails to work as expected the primary cause of frustration for the searcher.
There is often talk of Google "changing the rules" from time to time. Do you really think they do so to make things more challenging for SEO activities? Not at all, Google is continually changing their methods and algorithms towards one primary goal, to produce the most effective results. If you happen to be out searching for "blue widgets", search Google for the term, and the results come back with the most useful and complete information you are looking for, you are a happy camper.
Therefore you can rest assured, when the Google team are sitting in their design meetings, they are discussing the best way they can provide that type of result. They are required to keep improving their methods because the competition is continually doing the same in an effort to keep up and even surpass them as the most popular search engine. It is clearly in Google's or any other search engines best interest that when you do a search for "blue widgets" that you indeed find what you are looking for.
When taking the first steps towards SEO, if your site is in the market of selling blue widgets, you need to ensure that elements of your site make that absolutely clear. The premium way of doing that is to ensure the content of the site is indeed about blue widgets to a human visitor to your site. Content is very much the key, how many times have you found the information you were looking for by viewing page source to look at the keyword tags? Not very often I would guess unless you happen to be an over the top geek.
All of the elements such as URL, page title, description, link building, and the like are only methods to assist the search engine spiders. The most important thing is content. Without it, all the other things may return short term results but not the long term results you are likely to be looking for.
|
|
|
Success in eCommerce, in any type of web based business, or simply building a web site that receives visits outside the scope of your family and close friends requires a plan and some effort, in most cases quite a bit of effort. As easy as it is for many of us to become lulled into the get rich simply by raising your hand method, its very unlikely to produce success. We've all seen the ads, "all you need to do is buy yourself a domain name", some claim you don't even need to do that, and just sit back and count the money as it rolls in. There are no magic formulas, no secrets to instant wealth, rather many who would have you play their game of smoke and mirrors while they get rich and you are out your "low, low price of $19.95".
Success on the Internet is no different than any other en devour, the investment of time and dedication, and knowing how to apply those resources are the key. Of course a really great idea doesn't hurt too much either as well as doing something you may enjoy. The thing that does make the Internet unique and provides the advantage over traditional businesses, are the relatively low startup costs and the far reaching effects which are possible. For an Internet business the world truly is your market.
I find the concepts of building a web site, promoting a business, and all the parts and pieces involved quite fascinating. I am a student really, having a thirst for knowledge, I enjoy learning the ins and outs of what may work and what doesn't. Much of what I know, I've learned simply by paying attention, as well as a few thousand visits to Google search. I began this journey with a small foundation of technical knowledge which I shared with others simply for the price of asking. When I encountered a problem that I didn't have the answer for, I went out and tracked it down. More often than not I managed to come up with solutions and all the while soaking up that knowledge.
And while my thirst on numerous occasions has been quenched, I find there really is no end to end all, there is always something else. I have come to the conclusion there is no single authority when it comes to the Internet or technology in general. There is not the way that is correct all the time in all conditions. I have discovered that things are not always as they appear, methods that go contrary to wildly held beliefs and are yet successful. I have found that the way that works, is the way that works, regardless of what the rule book says, and yet there is that constant of "does it make sense", because sometimes the rule book doesn't.
I enjoy sharing my knowledge and the things I've learned, and I enjoy helping others. That is what motivates me and provides me with a level of personal satisfaction. I am never afraid to say "I don't know", but I am always willing to do what it takes to find out. The articles I post here on this web site, I do because I feel they can be helpful to others who may also have that thirst for solutions. My solutions may not always work for everyone all the time, but they have worked for me and so I share. Call it generating positive karma or whatever you will, for as long as I have something useful to share, I'll keep doing just that. |
|
|
osCommerce - Basic Customization |
|
|
|
This is the first in what I plan to be an ongoing series of articles concerning osCommerce and its architecture. We will start out with some basics and eventually get into some more complex issues as the series progresses. To get the most value out of these articles, its going to help a great deal if you have at least a basic understanding of HTML, PHP, and Cascade Style Sheets (CSS).
When you look at osCommerce as a whole, it can be rather daunting. The system is extremely robust, but with that comes some complexity. However with many things large and complex if you begin by breaking them into little bits, trying not to chew too much at one time, it all becomes a lot easier to digest.
The great majority of osCommerce installations start with the basic default package. Whether you uploaded it yourself and followed the included installation routine or it came from your web hosting though Fantastico or some other means, you start out looking at a 'default' osCommerce installation. At that point right out of the box you have a working shopping cart. Now its time to start putting your customizations to your new shopping cart, to start making it your own. In order to perform those customizations you need to start gaining an understanding of how things are put together, so lets start there.
If you were to examine the code within the pages that make up the system, you would find that every visual page contains several common parts. Speaking specifically about the visual parts, there are four external files with are 'included' into each visual page, these are header.php , column_left.php, column_right.php, and footer.php. In each visual page within osCommerce there is one master table that holds everything which in a nutshell looks like this image:

The file names themselves are fairly self documenting. The header.php contains the main logo or graphic that appears on the top of each page. The column_left.php and column_right.php each contain the various utility boxes such as shopping cart, reviews, best sellers, new products, etc. And the footer.php contains the copyright notice. Finally the center of the table, the 'body content' is defined within the individual page.
Now there is a little more to it because each of these files can in turn also include other files to help define them, though essentially if you want to change the appearance of an area of the your cart the corresponding file which defines that area of the page is where you will begin to work. Remember because all four of these files are included in each page of the cart, when you make a change to any one of them, you change the appearance of every page in your cart.
So lets wrap this up with a practical example. One of the first things anyone wants to do with a default installation of osCommerce is change the banner at the top of the page. Now we know that because the banner appears at the top of the page we want to take a look at header.php.
As with all four of these files we will find header.php in the includes folder. Opening up the file we find the following code at around line 57:
<td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?></td>
The part of this we want to pay particular attention to is:
tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce')
tep_image is an osCommerce function which renders an HTML image tag. The function takes two parameters, the image file name and the image 'alt' text. The 'DIR_WS_IMAGES' is a defined constant which refers to the images folder. So translating that the first parameter in this case is actually images/oscommerce.gif . The second parameter, the 'alt' is 'osCommerce', this is the text that will show up in the balloon when a user holds their mouse cursor over the image.
Lets assume that you have a logo image for your store which is named mystore.gif. Swapping out the logo images is a fairly simple process. First you would upload mystore.gif to the images folder. Secondly you would edit the code by changing oscommerce.gif to mystore.gif. And finally change 'osCommerce' to your store name or something else appropriate. Save and upload the file and you are done.
A couple of notes to keep in mind:
The dimensions of oscommerce.gif 204 pixels wide by 50 pixels tall. If the dimensions of your logo differ it will effect the appearance. Sometimes it won't matter other times it will and you might have to experiment. In the future we will talk about changing the entire header.php file for a different look.
The most common mistake anyone makes are misplaced or missing apostrophes ( ' ). If you are getting errors that's always the first thing to check for.
And the most important thing, before making a change to any file in the system ALWAYS make a back up of the file first, so that you always have something to fall back on if things go very wrong.
Happy Coding! |
|
|
osCommerce - Language Files |
|
|
|
Previously we talked about some files which are included in most pages of the osCommerce system, header.php, column_left.php, column_right.php, and footer.php. All four of these files deal directly with the visual appearance of osCommerce. There are some other files which are also included in each page with in the system. application_top.php and application_bottom.php are two of these files. application_top.php is basically the bootstrap include for each page. It contains calls to connect to the database, constant definitions, etc. And application_bottom.php serves as a clean up file for the page.
There is also another file included, the language file, and that's what I'm going to center this discussion on today. The architecture of osCommerce provides support provides for localization through the use of language files. Out of the box, the default installation of osCommerce provides support for three languages, English, German, and Spanish. It is through the use of these language files that the system is able to dynamically adjust to the chosen language of a visitor to your cart. For example if a user to your cart modifies their personal language setting to German the labels, buttons, and other text on the pages of your cart will appear in German. Same thing for a user choosing English or Spanish, through some available osCommerce contributions or simply by doing it yourself other languages can also be added by following the existing model.
If you look at the code for a visual page, somewhere near the top you'll find a line of code that looks similar to this:
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT);
Of course we can expect that DIR_WS_LANGUAGES is a defined constant for the 'languages' folder and that assumption would be correct, this folder can be found within the 'includes' folder. '$language' is a PHP variable, if you are new to PHP variables always begin with the '$' character, its value is the language chosen by visitor to your cart, i.e. English. FILENAME_CREATE_ACCOUNT is a defined constant, file name constants are defined in the filename.php file which is also found in the 'includes' folder. In this specific example FILENAME_CREATE_ACCOUNT is defined as create_account.php. So when your web server reads this file it sees:
require(languages/english/create_account.php);
So now lets go back and take a look at the languages folder. Inside we see three files english.php, german.php, and espanol.php. We also see three folders with similar names, English, German, and Espanol. What I am going to explain here applies equally to all three default languages, but for the sake of simplicity I'm going to refer to English.
The english.php file is a general purpose language file. Meaning that it contains language definitions which are applied across all pages. Let's take another look at some example code:
define('HEADER_TITLE_TOP', 'Top');
This is taken from the english.php file and defines the word 'Top' which appears at the far left of the breadcrumbs trail on the navigation bar. I specifically used this example because it appears on every page of an osCommerce cart and because it's frequently a piece of text that site owners want to change when they start customizing things. So lets say rather than 'Top' we wanted it to say 'Home', we would just simply modify the code to look like this:
define('HEADER_TITLE_TOP', 'Home');
Rather than 'Top' in the breadcrumbs trail, 'Home' would appear on every page of the cart. As developers we always want to be able to make changes in a single location and have the change appear everywhere it's used. english.php accomplishes this goal for words that are used in multiple pages within the cart.
Now an osCommerce shopping cart is made up with a few dozen visual pages, most with text and several labels. In theory we could include all of those definitions within the english.php file, after all it is available to every page in the cart. However if we were to do so the english.php file would grow rather large. Performance would be impacted not to mention it would become fairly difficult to manage. So to address that issue the architecture of osCommerce uses language files which are specific to the individual pages in the cart.
Lets take a look inside the 'languages/english' folder. Inside we find a list of files that basically mirror the file names from the root folder of the osCommerce cart. It makes it all fairly easy to follow because the language file has the same name as the visual file, it's just in a different location. Browsing the list of files we can find create_account.php from our example above. Inside this create_account.php file we will find the English translations of the labels and text that are specific to the 'Create Account' page.
So lets do a practical example. After you have done a default installation of osCommerce, you have this working shopping cart. But right in the middle of your home page is some text along the lines of 'Congratulations your installation of osCommerce was successful......" Obviously this is one of the first things we want to change for our new cart. Since the main page of our cart is index.php we are going to go looking for the language file at includes/language/english/index.php. Lucky for me and this example the file is there where I would expect to find it.
Before we open up the language file, lets take a look at the code for the main page, the index.php file which resides in the root folder. Inside this file there is a lot of code dealing with displaying new products, etc. But if we scroll down almost to the bottom of the page we find this section of code:
<td class="main"><?php echo tep_customer_greeting(); ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td class="main"><?php echo TEXT_MAIN; ?></td>
Now the first line that says
'<?php echo tep_customer_greeting(); ?>' That calls a function to display the customer greeting, 'Welcome Guest would you like to log yourself in?....' We're not going to cover that at this time, but I wanted to point that out to avoid confusion. What we are looking for here in the last line in the example:
<td class="main"><?php echo TEXT_MAIN; ?></td>
This is where the larger body of the main page text is coming from. Its saying to echo or print to the screen the value of the constant 'TEXT_MAIN'. Ok so now we know what to look for, we can go ahead and open up includes/language/english/index.php. The first define statement in the file looks something like this (It's rather long so I've shortened it for this example):
define('TEXT_MAIN', 'This is a default setup of the osCommerce project, products shown are for demonstrational purposes, <b>any products purchased will not be delivered nor will the customer be billed</b>. Any information seen on these products is to be treated as fictional.........');
You'll likely want to be more creative, but for the sake of example lets assume you want to change the text to read 'You have arrived at my new store'. You probably have the hang of it by now and you should as the change is simple:
define('TEXT_MAIN', 'You have arrived at my new store');
Save the file and upload and you're done, well almost. If your intentions are to keep your site multilingual, you also need to make the corresponding changes in the includes/languages/german/index.php and includes/languages/espanol/index.php files. with the proper translations for those languages.
Finally there is one other thing that falls outside the rule for language files and that is 'buttons'. If we go back to the 'includes/language/english' folder, we can see a sub folder there named 'images' inside the 'images' folder we can find a 'buttons' folder. The whole path goes like this, 'includes/languages/english/images/buttons'. This is where all of the button images are stored which are used for the osCommerce cart. Since the buttons display text, those too are displayed in the selected language. For example button_continue.gif in this folder is the button which displays 'Continue' in English. To make modifications here you'll need to open up Photoshop or another graphics editor, which is beyond the scope of this article but perhaps something we will tackle in the future.
Happy coding! |
|
|