|
CONFIGURATIONSkin ImagesThere are several default images that come with the Review Foundry distribution and which appear on the public pages. For example, the little yellow alarm clock that appears next to the link for the page where visitors can subscribe to review alerts. You may wish to replace some of these images with your own versions. You could directly insert the HTML code that references an image on your site, but then you destroy the portability of your skin. To replace images in a way that preserves skin portability, see the next 2 sections on Replacing General Images, and Replacing Rating Images. You may also want to add new images to the skin templates. For example, you might want to add a common image to the navigation.ttml template, so that this image appears on all pages. To do this in a portable way, see the section on Adding New Images. Replacing General ImagesTo replace any of the default skin images, go to the Skin Images frame of the Configure control panel. There you will be presented with all of the replaceable images common to all skins. Each image is displayed, so you can see what it currently looks like, and a file upload form element is located next to it. The actual name of the image file is shown to the right of the upload button. For example, the entry for the image used to indicate review subscriptions might look like this:
To replace this alarm clock image with something else, click on the Browse... button to bring up the file upload dialog box. Navigate to an image file on your system, select it, then return to the Skin Images frame. When you save your image settings by clicking on the Update Images button at the bottom of the page Review Foundry will upload the new image, determine its width, height, and file name, and write these to the current skin configuration file. In this case, because the image variable name is image_misc_review_alert, the new image file is uploaded to the image directory named: /html/path/to/.../skins/default/images/misc/ The corresponding file name/width/height information is written to the file: /cgi-bin/path/to/.../my/skins/default/SkinData.pm Replacing Rating ImagesMany skin authors are likely to want to replace the images used to represent a review rating. The replacement procedure mirrors that discussed in the previous section, and is complicated only in that several component image files may be involved in the construction of a "single" rating image. Review Foundry offers 4 different ways to display ratings in a graphical format:
Adding New ImagesThe trick to adding new images to a skin is knowing where to put them and how to reference them from that location. Placement is easy enough, you can put a new image file anywhere in the HTML arm of your skin. However, to reduce confusion you should probably create a specific subdirectory where all your added images can be found. For instance, if your skin is named "Red Planet Skin" you might create the subdirectory: /html/path/to/.../skins/red_planet_skin/images/custom/ You are, of course, free to create any subdirectory structure within this added directory. In the templates you'll need to reference image files in your custom directory. To do this you can use the URLs defined in the configuration file. These are accessed by referencing the global.cfg hash which is passed directly to all Template-Toolkit templates. Thus, you can use something like the following to specify the URL of an image file named mars_closeup.gif found in the /custom directory: [% image_url = global.cfg.site_html_url _ global.cfg.site_app_url _ '/skins/' _ global.cfg.skin_id _ '/images/custom/mars_closeup.gif' %] Remember that the underscore is the concatenation operator in Template-Toolkit templates and the TT parser would fill in the values something like this: [% image_url = '/rs' _ '/foundry' _ '/skins/' _ 'red_planet_skin' _ '/images/custom/mars_closeup.gif' %] i.e. [% image_url = '/rs/foundry/skins/red_planet_skin/images/custom/mars_closeup.gif' %] To turn any image URL into an absolute URL simply prefix the relative URLs shown above with global.cfg.site_document_root_url which is the URL for your homepage. Note that by referring to the URL values from the configuration file the URL specification becomes portable: the value for [% global.cfg.site_html_url _ global.cfg.site_app_url %] is the site-dependent path to the Review Foundry HTML bin. Note also that you MUST use [% global.cfg.skin_id %] in the template instead of the literal string 'red_planet_skin'. Not only might you rename your skin at some stage (and hence invalid your image references) but users of your skin will almost certainly rename the skin. Later in your template you'll insert the value defined above into an img tag something like this (it is always a good idea to put in the width and height of your images, though it is not mandatory): <img src="[% image_url %]" width="420" height="60" border="0" alt="mars closeup"> « Table of Contents | Obtain Review Foundry » Copyright © 2004 Random Mouse Software. All Rights Reserved. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||