This help file is intended for the website designer/developer to aid with integration and use of the cms.
A theme is a collection of files and folders used by the cms to control the visual look and layout of the website. Theme files typically consist of html, css and image files just like any website. The html files in an active theme folder are used as page templates by the cms to display any number of pages.
At the very least a theme should consist of at least one page template file that is named default.php (or .htm/.html). This default page template is used for displaying all pages unless another page template is specified when adding/modifying a category/product etc. in the admin control panel. A theme might also include other page template files, images, style sheets, item template files, custom include files etc.
If you are creating a new theme you can copy the existing default theme folder and rename it. This will ensure all required style sheets and images necessary for the cms to display properly are present in your new theme. If required images and stylesheets do not exist in a custom theme folder then the ones in the default folder are used instead, therefore files in the default theme folder should not be modified or removed as they are used as defaults if a custom theme is missing a critical file.
If you are logged in as admin then new or modified page template files are imported automatically from the active theme folder and stored in data/templates. You can also manually reset/update page templates by going to Maintenance in the admin area.
These special tags can be used in page templates to display/position dynamic content from the cms.
{page_content}
Put this tag in the <body> section of your page template to define where you want the dynamic content displayed. You can also add additional content areas by appending extra text onto the tag eg. {page_content_1}, {page_content_2}, {page_content_test} etc.
{page_meta}
This includes any stylesheets and javascript code needed by the CMS
If not included the page meta code is included at the end of the <head> section automatically but you can position it manually in the code using this special tag
{account_menu}
Displays the user account menu with login and register links
{cart_menu}
Displays the shopping cart and checkout links
{breadcrumbs}
Displays breadcrumb navigation
{recently_viewed}
Include recently viewed items with the code below
{terms}
Displays the terms and conditions as configured in admin
{cms_url}
Use this to insert the absolute url to the cms main index.php in your code eg. http://www.mysite.com/
{cms_root_url}
Use this to insert the absolute url to the cms root directory in your code eg. http://www.mysite.com/cms/
{cms_theme_url}
Use this to insert the absolute url to the active theme directory. For example you could use {theme_url}styles/mystylesheet.css to link to a style sheet in your theme/styles folder eg. http://www.mysite.com/cms/themes/mytheme/
{cms_link_cat,0}
Use this to insert an url to the specified category, replace 0 with category id.
{cms_link_news,0}
Use this to insert an url to the specified news article, replace 0 with article id.
{cms_link_product,0}
Use this to insert an url to the specified product, replace 0 with product id.
{menu_accordian,0,0}
display a dynamic accordian menu, replace first 0 if needed with a parent category id, change second 0 to 1 to change accordian effect (noaacordian keep multiple sub menus expanded). Modify plugins/accordian_menu/styles.css to change menu colours and sizes.
{menu_treeview,0}
display a dynamic treeview menu, replace first 0 if needed with a parent category id
{jquery}
use this tag to replace any jquery lines that exist in the template with the cms jquery file in plugins/jquery/jquery.js
{jquery_selectboxes}
use this tag to change normal select boxes in forms into advanced jquery select boxes
{inc_myincludefile.php}
Include a custom php file in your template where "myincludefile.php" is the name of the file, the file needs to be in themes/theme_name/includes/
The following tags are used in conjunction with category images. The names are interchangeable so for example you could have a slider and a gallery using the same name and therefore sharing the same category images. This is useful if you have a slider on a desktop template but want to have a gallery instead on the mobile page template.
{slider_myslidername,catid,width,height}
To add an image slider to a page use this special tag. The image slider will pull images from the specified category id or the current one if no id is specified.
{image_myimagename,width,height,urlonly}
This tag can be used to allow adding and changing of images to specific places on the page template. Assign images by modifying the category and seleting the appropriate "Assign to" name. Multiple of these tags can be added with different names if needed. If urlonly is set to 1 it will output only the image url.
{gallery_mygalleryname,catid,tn_width,tn_height,cols}
This tag can be used to display a gallery of images on the page template. The gallery will pull images from the specified category id or the current one if no id is specified. Multiple of these tags can be added with different names if needed.
Categories are used to display listings which can be products, news items or user listings. A category can also be used for a standard webpage without listings. You can display a category and it's listings on any webpage by using the code below. Remember to also include the required pieces of code above.
$category_details=get_category_details($category_id);
// You can override category settings by here, for example...
$category_details['heading_visible']=0; // hide/show heading 0/1
$category_details['listings_visible']=1; // hide/show listings 0/1
$category_details['display_format']='products_sidebar'; // use a different display format for listings
$category_details['cols']=2; // set the number of columns
$category_details['rows']=1; // set the number of rows
$category_details['tnx']=2; // set the width of thumbnail images
$category_details['tny']=2; // set the height of thumnail images;
$output=display_category($category_details,$page_number,$search,$specific_items,$category_div_style); // only $category_details is required
echo $output['content']['main']; // ['content']['main'] is the main content area, other custom content areas in the category can be output too
$category_id = the id of the category that you want to display
$page_number = display a categories sub page
$search = null or an array containing search keys and values
special reserved search keys listed below. Specifying custom search keys will use exact match/case insensitive, end a search key with "_lax" for a non exact search/contains search value eg. search[location_lax]=rela will match ireland. To omit from the search process append omit_ eg. search[omit_this] or leave the value blank eg. search[this]=""
'phrase' = search items using a general search phrase, typically for searching item ids, name, keywords - specify negative keywords with a preceding hyphen eg -keyword or perform an exact match with square brackets eg. [exact keyphrase]
'price' = display only items within a specified price range eg. 0,200 for 0 to 200 - or enter a single price to display listings greater or equal to the specified price
$specific_items = provide an array of item ids to display specific items regardless of category or search
Call the php function below to display category images in a table.
display_category_image_table($category_ids,$cols,$tnx,$tny)
$category_ids - an array of category ids
$cols - the number of table columns
$tnx - thumbnail width
$tny - thumbnail height
A category by default will display only items that are assigned to it. The search filter allows you to override this behaviour and control what items are displayed in the category. Search filters should be separeated with a colon : character.
eg. cat=0,123456789,987654321:sort=priority
Reserved names are:
Other names can be used in custom scenarios eg. bedrooms=3,location=nass etc.
The following variables can be used in certain php files used by the cms to insert custom html code. eg. product_detail.php news_detail.php
$page_meta - for inserting html code just before the closing </head> tag
$page_start - for inserting html code just after the opening <body> tag
$page_end - for inserting html code just before the closing </body> tag
You can use the cms to create protected download links that only registered users can download. eg http://www.mywebsite.com/?download=filename.jpg
When an image is added to a product it is stored in the folder for that particular product along with the product details file. If the uploaded image is particularily big it will be resized to a reasonable size. These main image files are not displayed directly on web pages but are instead used to generate copied image files at varying sizes. These copied images are cached in the images folder in the cms root folder. This means when you do a backup only the main image files under the data directory are backed up which keeps backup sizes smaller.
The root images folder is for dynamically created images like product thumbnails. It is essentially an image cache.
The data/images folder is for images uploaded using the pdw image browser in the wysiwyg content editor. Because these images are uploaded and stored in the data folder they are included in backups. Ideally images used in site content should be uploaded here so they are backed up too.
Images displayed on listings such as news articles and products can be watermarked by enabling the various watermark settings in the scripts/config.php file. The watermark image file must be a png file named watermark.png and uploaded into the images directory for the active theme eg. themes/mytheme/images/watermark.png - If the file is not found it will by default try to use themes/default/images/watermark.png - it is recommended to use a png with alpha transparency for best effect.
Backups made through the cms admin area include only the cms data directory and do not include theme files. As theme files are created on your computer you should always ensure you keep a local backup of them. The cms data backup requires the php function shell_exec to be enabled on the server.
If the default backup method does not work you can try switching to alternate method in scripts/config.php
Backing up will create a compressed tar file of the cms data directory.
You can also manually download the cms data directory via an ftp client although the process will be slower. To restore a manually downloaded data directory use a program like 7zip to make a tar file of the downloaded data directory and then compress it with gzip. Upload this new file to the cms/backup directory and you will then be able to restore it as normal from the backup page in cms admin area.
A cron job can be setup on your server so the cms will check automatically for expired subscriptions and send queued emails in the mailer.
eg. wget -q http://www.mysite.com/cms/scripts/cron.php
If you are upgrading to a new version of the cms you should bear in mind any modifications you may have made to the cms files. Files that may have been customised for each install..
/scripts/config.php
Please see the cms update guide for more detailed information.
It is recommended not to move from from a 64bit server to a 32bit server as there may be problems unserializing large integars from data saved on the 64bit system. Possible workaround: large integars in data files can be manually change to strings eg. i:1234567890123 to s:13:"1234567890123"
** Exporting product data from CMS to CSV file **
1) In the CMS admin area go to Products
2) Use the Category dropdown and search to filter the products you want to export or skip this step to export all products
3) Click the Export button at the top of the page and wait a moment for the export to process
4) When prompted the export is complete click the download link to download the CSV file to your computer
** Importing CSV data into Spreadsheet Program such as Excel **
1) Use the open file or Import file in your spreadsheet program to import the CSV file
2) Set the Pipe character | as separator (usually it defaults to comma) - you may need to select "Other" and type in a single Pipe character |
3) Text marker should be set to None (usually it defaults to quotes)
4) Character set should be set to UTF-8
5) On the import dialog/wizard make sure that the following columns are set to TEXT
ID - CODE - NAME - CONTENT - META DESCRIPTION - META KEYWORDS - PRICE TEXT - CATEGORIES - IMAGE FILENAMES - YOUTUBE VIDEO ID
6) Once imported save in your spreadsheet programs native format (eg. xlsx for Excel) so you can more easily update and work on it
A white blank screen without error will most likely mean an out of memory issue, usually if there is a lot of stored item data. To increase memory on scripts use...
ini_set("memory_limit","32M");
Add this code to the top of individual scripts or to the main admin index.php file and cms_front.php to cover all scripts.
Estimated memory requirements...
16MB for 10000 products
32MB for 12000 products
Category pages and navigation menus are cached for faster page loads and lower memory usage.
Only category pages with items that are accessible to everyone (user group 0) are cached. Using user group access restrictions on categories or individual items will prevent caching and may impact performance, especially if there are lots of items.