![]() |
|
|
|||||||||
|
Creating Your Template Page If you purchase a catalog installation, we will take care of integrating the PHP codes into your web site for you at no additional charge, provided your site is a straight HTML file with no CGI, SSI or other code, are not framed pages and do not use FrontPage components. (If you do have a page with these components, there will be an additional charge to set up your catalog.) If you are installing the catalog on your own, or if you want to change your catalog's page design, you will need to make sure to include your catalog codes within your page design. All About Includes First, here are some basics about includes. This will help you understand how the process works. If you already know this part, skip ahead. Remember playing with Mr. Potato Head® as a child? You had a plain potato body, with holes where the eyes, nose, mouth, ears, feet and hat go. When you wanted to create a face, you'd find the pieces you wanted to use and place them in the appropriate holes to create a different Mr. Potato Head® face each time. The OptionCart catalog works very much the same way. You create a single blank HTML page that works just like the Mr. Potato Head® body. In this page are "placeholders", that work just like the holes in the potato - they are indications of where different pieces will go. With the Mr. Potato Head® you have to choose the pieces and put them into the holes. With OptionCart, when the customer chooses a category or keyword, the "pieces" are automatically put into the placeholders for them in milliseconds, through PHP programming. So you can see that it's much different - and easier - than creating static (ie. "non-changing") HTML pages and adding the products to them. All you need to do is create the placeholders (like the holes in the potato) in your HTML code, and when the customer views that catalog page, the holes will be replaced by products that fit their particular requirements. Keep in mind that the Mr. Potato Head® body doesn't have any features on it until you put them on. So when you're looking at the potato, it's just going to look like a potato with holes in it. Your catalog page is the same - it will look just like a blank page, with nothing but placeholders where the products, title, categories, etc. are supposed to go. It's not until you look at it on the server that you can actually see all the different pieces! That's a bit hard to understand at first when you view your catalog page in a WYSIWYG program like FrontPage, because it looks "blank". But trust us, when you put it up on the server, it won't look blank! Also, you will no longer have to create 20 pages when you have 20 categories of items - you just create one single blank page with placeholders, and the catalog takes care of all the rest of the details. Pretty cool, huh? Simply create an HTML template, name it catalog.php (in the deluxe version, you can change this to catalog.htm or other .htm files if this feature is enabled), and insert code snippets into the HTML wherever you want different parts placed (these are your placeholders). The following are the codes that can be included in the deluxe catalog: <?php include("inc/title.php"); ?> <?php include("inc/description.php"); ?> <?php include("inc/navbar.php"); ?> <?php include("inc/navlist.php"); ?> <?php include("inc/search.php"); ?> <?php include("inc/viewcart.php"); ?> <?php include("inc/viewcontents.php"); ?> <?php include("inc/products.php"); ?> <?php include("inc/catnum.php"); ?> <?php include("inc/price.php"); ?> <?php include("inc/categories.php"); ?> <?php include("inc/meta.php"); ?> <?php include("inc/metatitle.php"); ?> <?php include("inc/style.php"); ?> <?php include("inc/advsearch.php"); ?> <?php include("inc/wholesaleinc.php"); ?> You also need to add the following code to the top of your catalog page, above your html tag: <?php include("inc/openinfo.php"); ?> Once the codes have been added, your page will be ready to display. Catalog Templates For FrontPage Users Still confused? This is the easiest method we've found for inserting your PHP codes when you're new to PHP includes and using a WYSIWYG editor like FrontPage to create your catalog page. PART 1: Creating Your Page 1. Create your page in FrontPage, just like you normally would for any page. 2. Unless you really know what you're doing, don't include FrontPage includes or borders, and don't use framed pages. ;) These can be tricky when you want to implement them with the catalog system. 3. Now here comes the fun part. Just type in some place holders in your page. You can name them whatever you want, but we recommend that you make them single words and put a % sign before and after them. And make sure you remember what you've used for which part. 4. Here's an example. Note that, where we wanted to put the category list, we just typed %CATEGORIES%. Where we wanted the search box, we typed %SEARCH%. Where we wanted a view cart link we used %VIEWCART%, etc.
5. Now, once you've got those in place, save the page as catalog.php. (Or if you're using the Deluxe catalog, you can use whatever name you specified in your admin area. And you can use a .htm or .html extension if you have the mime type set to allow these extensions. If you're not sure if you do, just use catalog.php.) PART 2: Adding The Code Now all you have to do is use the Find/Replace function to insert your script codes! 1. Go in to the page again, but view the HTML code this time. If you're not familiar with HTML, this is going to look strange. But don't worry - you don't have to understand all the code. 2. Now, go through and do a Find/Replace (in FrontPage for Windows this is Ctrl+H). And replace each of those codes with the code snippet we have listed in the code section. 3. In the above example, we'd find %CATEGORIES% and replace it with: And we'd find %SEARCH% and replace it with: And so on, until all of those placeholders we added have been changed over to script includes. It's just a simple find/replace. 4. Now you need to add the code that opens the database. At the very top of your HTML code (you're still in HTML view, right?), add this line: <?php include("inc/openinfo.php"); ?> This will go above any other line on the page! That's very important. 5. One last thing. If you have the deluxe catalog, you can add dynamic titles and meta tags. What that means is that you'll have specialized titles and meta tags for each of your categories, and specialized titles for your items. This will greatly help in your search engine rankings, so we recommend that you do this. In place of the title at the top of the page, which will look something like: <title>My Company</title> add the following: <title><?php include("inc/metatitle.php"); ?></title> You don't need your <meta> tags if you add these codes - the system does it all for you. That's it! Your catalog page can be FTP'd into the server and you should be ready to start viewing items. |
|
|
Privacy Policy: We respect your privacy. We will never give your email to third party companies nor use it for sales Copyright 2002-2006 Small Biz Community, LLC |