The jomres asamodule plugin

From Jomres v4 manual

Jump to: navigation, search

Contents

Introduction

The Jomres ASAModule plugin for Joomla is a new plugin (as of mid-April 2010) which allows you to call certain tasks as modules.

Background

Many plugins in Jomres can be called as discreet "tasks". These are typically plugins where a minicomponent is numbered "06000". They were written as such to allow me to develop new functionality without needing to edit jomres.php to enable them to be called. An example of a discreet task would be the Remote Access of the calendar functionality, where you can access the availability of a calendar by passing a task of "remoteavailability" and the id of the property who's calendar you want to see.

This functionality has been around for quite a while, however the creation of the jomres_asamodule Joomla module means that many of these tasks can be called in module positions on pages which are not typically Jomres pages.

A working example

Sticking with the remoteavailability example (which isn't ideal as a module because of it's size, but nevertheless it's a good example), we'll talk you through using jomres_asamodule. This discussion assumes that you're familiar Joomla modules, positioning and publishing them.

First, you'll need to go to the Jomres Plugin manager and install the "alternative_init" plugin. This is required by jomres_asamodule because it sets up various Jomres files that are needed to run minicomponents.

Next, in the plugin manager again, install jomres_asamodule. This installs a module into Joomla. Now go to Joomla Module Manager and click the New button on the top right of the page. Next, you need to click the "Jomres AsAModule" link. This will take you to the module configuration page. Give your module a title (for example "Availability") and ensure that the position is appropriate for your template. On the right hand side, you now need to choose a task and any arguments. For the remote availability functionality, you'll set the task to "remoteavailability" and the arguments to "&id=1" (where 1 is the property's unique id. You can see this in the property selection dropdown on the manager's toolbar in the frontend). If the task in question requires more arguments, they'd follow the pattern "&a=1&b=2&c=3", which is exactly what you'd see in the address bar of your browser.

Click Save (make sure the module is published/enabled) and go to your site's main page. You should now see the availability calendar in a module.

Jomres plugins that can be used in asamodule

At the time of writing, this functionality is new, therefore some plugins are still being modified to work with ASAModule. If you're in any doubt, please raise a support ticket, or post your question on the forums.

Search modules are unique modules and don't need to be called via ASAModule.

Task/Plugin 
featured_properties
Description : Shows your featured properties (configured in administrator area) with the first at the top, and the second/third/fourth in three columns underneath.
Arguments : None.
Task/Plugin 
popular_properties
Description : Scores reviewed properties by ratings, and shows them in lists, highest scored first. Offers links that allow you to drill down to countries/regions/towns to see rated properties in those areas.
Arguments : None.
Task/Plugin 
stepz
Description : Shows the guest where they are within the booking process.
Arguments : None.
Task/Plugin 
tag_cloud
Description : Shows a tag cloud of different towns, towns with more properties are bolder than those with fewer properties.
Arguments : None.

Some functionality already exists in a core installation of Jomres, and as such they only need to be called, without installing any plugins

Task 
remoteavailability
Description : Shows the availability calendar for a given property.
Arguments : "&id=1"
Task 
contactowner
Description : Shows the email property form for a given property
Arguments : "&selectedProperty=1"
Task 
show_property_reviews
Description : Shows all reviews for a given property
Arguments : "&property_uid=1"
Task 
show_site_business
Description : Shows the administrator's business details.
Arguments : None
Task 
terms
Description : Shows the terms and conditions for a given property
Arguments : "&property_uid=1"
Personal tools