Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
422 lines (295 sloc) 10.2 KB
=== <WARNING> ===
We don't pay any heed to backward compatibility for Wellwell until
it is announced as stable and mature enough.
=== </WARNING> ===
WellWell is the new Interchange Shop Starter Kit.
It's main difference from previous IC demo catalogs that it doesn't tend to be a demo, but rather a frame for building new catalogs.
It's main building blocks are components, assembled together with [compose] called from within pages.
Flaws in Standard / Interchange
* two shopping carts components to maintain
* components need to specified on every page instead of globally
* incomplete ITL doesn't crash whole page
* No stone will be left unturned.
* KISS instead of convoluted ITL code in standard and predecessors.
* Death of [process] (almost done).
* Supersede Interchange's routes and profiles with form framework.
* Keep core of WellWell small, use plugins for extended functionality.
In consequence this deprecates the following tags in this scope:
[button], [image].
Interchange 5.7.1 and at least: 1.103 2.104
[compose] basically just evaluates the components passed inside the [compose]
tag and fits them into the containers inside the template.
Templates are HTML files with placeholders for the containers.
The placeholders are uppercase words inside curly braces.
A very simple template would look like:
Components are evaluated as ITL and put into the placeholders.
To automatically create a wrapping div for each component,
Automatic components/attributes
Usually certain components appear on every page and you don't
want to specify them inside the [compose] tag.
[compose] examines the following variables which set
components and attributes globally:
Variable MV_COMPONENT_AUTO htmlhead:htmlhead left:menu,categorynav body:infobox
Users, Roles and Permissions
Users are stored in the "users" table. The primary key is "uid", quite like
an Unix user id, which is used to identify the user through the system.
Other settings, like username and email, can be changed by the user.
Roles allow to group users and grant them permissions. Users are allowed
to be in multiple roles.
Roles are stored in the "roles" table. The primary key is "rid", quite like
an Unix group id, which the exception of the two default roles (anonymous
and authenticated).
The default user roles are:
* Anonymous user: this role is used for users that don't have a user account or that are not authenticated.
* Authenticated user: this role is automatically granted to all logged in users.
The anonymous user has always the rid of 1 and the authenticated user has
always the rid of 2.
This matches the following records in the permissions table:
rid | uid | perm
1 | 0 | anonymous
2 | 0 | authenticated
The relationship between users and roles is kept in the "user_roles" table,
uid | rid
1 | 3
1 | 4
Permissions can be assigned to a role or to an user. If you want
to restrict some content, you can use the [acl] tag for checking
for proper permissions.
The following example produces a link only if the current user
has the "create_content" permission.
[acl check create_content]
<a href="[area new_content]">Create content</a>
[acl] returns its body on success or the permission if body is
Please note that [acl check] without a permission is always
Acl parameter in [compose]
Permissions can be checked for a complete page like that:
Please note that submitted [form] forms bypass this permission
check because they are evaluated during autoload.
Only menu entries with sufficient permission will be displayed
(permission field in menus table).
The recommended way to call [form] forms is within the compose tag:
components.body="product_info wishlist_add""wishlist_add"
Each form consists of one or multiple subforms, called parts.
The parts are stored in the "form_series" table:
name Form name
part Part name
label Label displayed on top of the form (optional)
template Template (optional)
profile Profile to check input in this part (optional)
position Position of part (1,2,3,...)
Forms are build from templates as well. The default template is located at:
Alternative templates can be specified in table form_series, field
The default template looks as follows:
{PREPEND} is a placeholder which can be used for form components.
{TOP} starts the HTML form.
{TITLE} shows the label field from form_series table.
{FIELDS} contains the regular form elements.
{SUBMIT} contains the button form elements (as specified in form_elements
table or default submit button)
{BOTTOM} ends the HTML form.
The elements of a form (part) are stored in the "form_elements" table:
code Serial number
name Name of form element
label Label for form element
component Part name
priority Sort order in form (descending)
widget Widget
The widget is passed by the form_element_field theme function to the
[display] tag.
One exception to that is the "legend" widget, which just displays the
label of the form_element.
Every form element can have a set of attributes, stored in the form_attributes
table. They are working pretty much the same as in the metadata table for the
Interchange UI.
Attributes can be applied for every form element with a certain name:
wellwell=> select * from form_attributes where name = 'country';
code | name | component | attribute | value
32 | country | | lookup_query | SELECT code,name FROM country ORDER BY priority DESC, name
Or only for a certain from:
wellwell=> select * from form_attributes where component = 'content_edit';
code | name | component | attribute | value
30 | uri | content_edit | width | 200
31 | body | content_edit | height | 400
There are two hooks for forms:
form_NAME_load (e.g. form_checkout_load)
form_NAME_save (e.g. form_checkout_save)
The first parameter for the hook sub is the part name.
The load hook is called for the setup of a form part. It is not
called if the profile check for the form part has been failed.
The return value of the load hook is either a false value or
a hash reference which can contain the following members:
page triggers a bounce to that page instead of displaying
the form
attributes hash reference providing defaults for form attributes
The save hook is called if the form part has been successfully
submitted (e.g. profile check successful).
Most aspects of a form can be 'themed':
* title
* elements (complete, label and field)
* submit button
Currently, you can modify one of the existing theme functions:
Regular components can also included in forms. Examples are
dynamic form parts and supplementary content.
Form components are stored in the "form_components" table.
name - form name
part - form part (empty if component applies to all parts of the form)
component - component name
location - placeholder used to place the component, e.g prepend for
{PREPEND} placeholder
priority - sort order in placeholder (descending)
Plugins are living in the plugins subdirectory of wellwell.
Plugins are activated by adding them to PLUGINS variable
(comma separated list of plugins).
Please read the README for the plugin first and follow the
instructions before activating the plugin.
Authoring plugins
Plugins are basically a small WellWell catalog on its own.
The configuration file is called plugin.cfg. The basic configuration
is as follows:
Message Loading helloworld plugin.
Variable CURPLUGIN helloworld
include plugins/default.cfg
Info file
The info file contains basic information about the plugin:
name = Hello world!
version = 0.1
author = Stefan Hornburg (Racke) <>
Directory structure
------------------- - info file (see Info file)
plugin.cfg - configuration file (see Configuration)
code - directory for custom code (tags, functions, ...)
pages/NAME - directory for pages
components - directory for components
Originals for (product) images are recorded in images table.
Paging can be controlled by passing parameters to [searchcontainer].
paging_startlinks => always show # links at the beginning
paging_endlinks => always show # links at the end
paging_slidelength => length of sliding window
96 pages, startlinks 3, endlinks 1, slidelength 5
page 1 shows: 1,2,3,4,5,..,96
page 8 shows: 1,2,3,..,6,7,8,9,10,..,96
1. Autoload
Autoload checks for form submissions so we can reroute the request based on
certain conditions.
More flexible routes needs modifications to Interchange itself, but here we go:
- complementing record files with record macros
Modules for Composition Framework
Vend::Compose::Address => addresses, [address]
- deal gracefully with discontinued items (through order_missing SpecialSub)
Jump to Line
Something went wrong with that request. Please try again.