space Baylys
Just practicing to pass the Turing test.
space
space
space
space
Developer for Hire!
space
addedValues Plugin
space

Home

What's new

Bayly.Root

Cornershop Plugin

space

Installing Cornershop

Configuring Cornershop

The Cornershop Macros

Cornershop RPChandlers

The Forex Plugin

The ShopFitter Plugin

Building a Shop with Metadata

Reference Sites and Links

Affiliates

callbacks

Career

edutools Root

Enhancements

Interests

linguist Plugin

Manila

Patches

Patches by Group

Papers

Sales

Sign My Guestbook

User(land) Relations.

Contact Address

Search Baylys

urlchains

space
Join Now
Login
space space space

Cornershop Macros

Cornershop has six macros that allow the website owner to add an interface to his shop to pages and templates.

  • cornerShop.macro.basketState(emptyBasket, notEmpty, hasThisPage, notAllowed, otherwise)
    basketState is a way to select one of a range of values according to the state of the users basket for this page. Typically the parameters will be the names of pictures - the shortcut names - and the result might be used in a pictureRef call, such as

          {pictureRef(cornershop.macro.basketState("emptyBasket", "basket", "basketplus", space: ,space: ))}
    

    the effect of such a macro call, is to select one of the images that you have chosen to represent a basket state on your website. Notice that the input parameters don't have to be picture shortcuts, they could be simple text messages, movies, whatever.

          {cornershop.macro.basketState("(Korb leer)","(Korb voll)","(dieses Buch ist im Korb)","",""))}
    

  • cornerShop.macro.basketStateImage(explanation=nil, hspace="", align="", usemap="", ismap=false, border=0, glossref="", vspace="", lowsrc="", rollsrc="", height="", width="", name="", id="", style="", class="", title="")
    basketStateImage is way to return an img tag whose src attribute is a url within the cornershop plugin. The parameters mimic those of the pictureRef macro and mean the same thing.

    This macro returns an image that is evaluated dynamically, even on a statically rendered page - thus allowing Manila websites with cornershops to be rendered statically.

  • cornerShop.macro.buyMe(formSection="", initialValues="")
    This macro returns a form or an empty string.

    If the formSection parameter isn't empty, it should be one of the literal strings "form, "/form", "formbody"; in which case the macro returns part of a form or an empty string. This allows additional form elements to be incorporated into the prebuilt form in a page dependent way. See "Product Options".

    If the basket state is well defined, the macro looks at the site structure entry for the current page and extracts the value of the Path Attribute named cornershop. It then calls the linkform renderer passing the name from the site structure; or the addedValues plugin passing the name of the user transaction form it shoudl present. The resulting form must contain at least a quantity field and a submit button.

    The initialValues parameter is way of passing values to the user transaction form in addedValues, its syntax is the same as the prmater in the addedValues macro beginUserTransaction. Typically, you use this mechanism to pas the page nessage number to the user transaction as a product identifier.

    Linkform form definitions can edited in a web browser using the "linkform Editor".

  • cornerShop.macro.addToBuymeForm(elementId, elementType, isRequired)
    This macro returns html text, which informs linkform of an added form element in a way compatible with linkform input validation and reqyired item checks. elementID is the name of the form elemnt. elementType can be "number" or "email", all others are ignored. Set isRequired to true if you require the user to enter a non empty value for this field. See Product Options

  • cornerShop.macro.showbasket()
    Showbasket returns an HTML table showing the contents of the users basket. It lists each item, along with the quantity ordered and time the entry was modified. Each item can be deleted from the basket. There's also a button to submit the basket for processing.

    The default script used to build the table can be shadowed by installing a script called showitems in the forms definition table. The ShopFitter Plugin is one way of doing this, by copying a script from a template website.

  • cornerShop.macro.basketDefined()
    This macro returns a true or false depending on whether a basket "makes sense" in the current context and for the current page. For example, pages used by editors to administer the website are not a context that "make sense". False is returned if the plugin is disabled, if the user doesn't have a valid cookie (see later) or if an optional callback script, called visiblebasketCondition, says not to show the basket. Otherwise it returns true.

    A typical use might be to make showing a buy Me form optional

     {if cornershop.macro.basketDefined() {cornershop.macro.buyme()} else {""}}