Review Site User Manual

UNDERSTANDING ARTICLE RECORDS

Adjust Text:  a a a a
« Table of Contents   |   Obtain Review Site »


UNDERSTANDING ARTICLE RECORDS

Although reviews are the focus of your site, it would be a big mistake to neglect your articles. These, after all, can be submitted to article directories. This will help bring in traffic and backlinks to your web site. You could submit your reviews to article directories too, but that would probably not be a very smart thing to do, because there would be no reason for visitors to come back to your site, and once your reviews go off-site you will have little control over the affiliate links that earn you money. You are much better off restricting your review content to your site only.

Below I will discuss the default columns that appear in your Article table. The tables are prepopulated at install time with example data so that you can see immediately how it all ties together. Should you feel the need to add new columns to the Article table (or delete them) you can, but it is probably unnecessary.

Disabling Articles

If you decide that you will not be adding articles to your site, maybe because you will be busy with a blog, you can disable the article area entirely so that it does not show up on your Review Site. Simply visit the Configure > Miscellaneous control panel and set this variable to Yes


misc_display_articles_disabled     Yes   No

Creating New Article Records

Article records are much simpler than those found in the Review table. You can, of course, add additional columns to the Article table if you need to, but your general article can be captured using just those columns you find in the default set up. If you visit the Database control panel in the admin area and pull up an Article record, here's an example of what you would typically see:


* ID   3
* File Name  
* Title  
Author  
Image  
Priority  
* Summary  
* Keywords  
* Content  
* Is Validated  


Note that to find a particular article you use the left side menus on the Database control panel. You first select the relevant table using the upper drop down menu. Then use the lower drop down to specify the action. You can either List Records from the table and click on the Edit link that is placed next to the record ID of each displayed record OR you can Modify a record by specifying the value of the record ID in the Primary Key box that appears when you choose the Modify option.

As was the case for the Review table, I have summarized below the purpose of each of the columns you'll find in the Article table (assuming no columns have been added or deleted since installation).

ID (id)

Once again, this is just the article record number, or PRIMARY KEY value of the record. It is assigned automatically each time you add a new record and can be ignored.

File Name (file_name) REQUIRED FIELD

This is the file name that will be used to specify the URL of the page on which your article appears. No need to add any file extension. That will be added automatically. It is suggested that you use lowercase and employ hyphens for the word delimiter. It is also suggested that your file name reflect the article title, which is the next field discussed. Note that you should try not to change the file name after you deploy it. If you do and the page is indexed, your visitors coming in from the search engines will come up blank the next time the (now invalid) file name is requested.

Title (title) REQUIRED FIELD

The title of your article. Choose a good one. Maximum number of characters is 255.

Author (author) OPTIONAL FIELD

The name of the author (or authors) associated with the article. Whether you add this field is entirely optional. Maximum number of characters is 64.

Image (image) OPTIONAL FIELD

This variable represents the file name of an image, such as beach-chair.jpg

As mentioned in the Review table discussion, images in Review Site are handled very simply. It is up to you to find images and add them, in this case, to the article image directory for the application. The default path for this article image directory is the following:

/rs/reviewsite/my/skins/default/images/article

IMPORTANT: Article images need to be EXACTLY 200 pixels in width. This is so they fit perfectly in the spot that has been allocated for them, just above the list of other articles that appears on the right of the page. If the image is of any other width it will not be displayed. If no suitable image is available for display, the default article image will be used, which is specified by the image_article_list configuration variable.

Priority (priority) OPTIONAL FIELD

This variable, which must be an INTEGER if supplied, determines where in the list of articles the current article appears. Use higher values to make the article appear higher in the list. You might use priority values that are multiples of 10, for example, which allows you to slot a new article into a particular slot if needed.

Summary (summary) REQUIRED FIELD

If you create an article record, you must provide an article summary. The summary may appear on the topmost page of your Review Site pages, in the Recent Article box. The summary is used to entice the reader to click on the READ MORE button. Whether you decide to add this summary to the article page is up to you, but the default behavior is to leave it out.

Keywords (keywords) OPTIONAL FIELD

Although search engines generally ignore keywords presented in <meta> tags, some customers have asked for a way to populate this field, so here it is. Feel free to leave it empty, and no keywords will be added as meta data.

Content (content) REQUIRED FIELD

This field is used to present your full article. It can be of any length. Use two consecutive linebreaks to introduce a paragraph break. While you can add HTML tags to your review, you should probably try to avoid it. However, if you need to add images, then go ahead and do so. There should be no problems provided that your HTML is valid.

Is Validated (is_validated) REQUIRED FIELD

This variable determines whether or not the article is added to the public pages. Unless you specify 'Yes' for the value, the article appears only on the administrative pages for editing purposes.

Creating New Article Fields

Unlike the Review table, for which special behavior is accorded columns prefixed with the compare_ string, there are NO special columns for the Article table. You can simply add new columns to this table using the general instructions found in the section on ADDING COLUMNS TO A TABLE.

On the other hand, articles are meant to be fairly basic in construction, so the existing columns should offer you enough leeway to put together plain articles. If you need to insert images into your article you can simply add the relevant HTML image tags to the article content.

If you do add new columns to the Article table you need to add Smarty tags to the article.tpl template so that the data can be added to the page. In that template you will find a conditional that looks like the following:

[% if $s.article_info && $s.article_info|@count %]
	some stuff in here...
[% /if %]

This conditional says "if there is an article_info hash and it has at least one column mentioned in it then do the following..."

So, if you added a column named Article.word_length to your Article table, part of the "stuff in here..." content might be Smarty templating code to access the word length like so:

	[% if $s.article_info.word_length %]
		Word length: [% $s.article_info.word_length %]
	[% /if %]

Of course the exactly HTML to use to format your database, and the placement of the data is entirely up to you. It's your template to improve. Just be sure not to add invalid Smarty constructs. Otherwise you will be greeted with error messages. Fortunately Smarty is fairly helpful with line numbering when it does detect a problem, so you ought to be able to figure out where you went wrong. Almost invariably it is the last thing you changed that is the problem. If in doubt, put things back the way they were and go study the Smarty documentation again. Under no circumstances should you come crying to me if you can't figure out what you are doing wrong. If you want to edit templates you need to learn how to do it the hard way - just like everyone else.

While we are on the subject of templating, you will notice the following Smarty tag to place the content of the article on the page:

	[% $s.article_info.content|nl2br %]

Notice the nl2br filter that has been applied to the text of the article. This filter replaces multiple instances of the linebreak character with two <br/> tags so as to preserve your paragraphs. If you want all the paragraphing to disappear you would just remove the |nl2br component from the tag.

Article Images

As I did with the section on Review images, I will risk repeating everything I have already said about adding article images so that I don't have to do it again and again in my support area.

Every record in the Article table has an Article.image column that can be used to record the file name of an image that you have added to the following directory:

/rs/reviewsite/my/skins/default/images/article

The file name will be something like beach-chair.png or whatever. It doesn't include any directory path since we already know in which directory the file is located (it's the one above).

Specifying an image to go with an article is entirely optional. If you do not specify an article, an attempt will be made to use the image specifyed by the configuration variable image_article_list which can be modified from the Configure > Skin Images page.

Article images MUST BE EXACTLY 200 pixels in width if the are to be recognized and used. This is because they need to slot into position directly above the article list on the right side of the article page.

If you can only get ahold of an image that has a width smaller than 200 pixels, you can simply create a new image with a width of 200 pixels (white background), and paste the smaller image at the center of it. In general, though, you will usually find an appropriate image and SHRINK it so that it has a width of 200 pixels.

If you need to add other images to your articles you can just add the relevant HTML tags directly to the content of your article.


Next Section: TROUBLESHOOTING

« Table of Contents   |   Obtain Review Site »


Copyright © 2008 Random Mouse Software. All Rights Reserved.