Stefan Hornburg (Racke) > Dancer-Plugin-Interchange6-0.008 > Dancer::Plugin::Interchange6::Routes

Download:
Dancer-Plugin-Interchange6-0.008.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source   Latest Release: Dancer-Plugin-Interchange6-0.051

NAME ^

Dancer::Plugin::Interchange6::Routes - Routes for Interchange6 Shop Machine

ROUTES

The following routes are automatically created by this plugin:

cart (/cart)

Route for displaying and updating the cart.

checkout (/checkout)

Route for the checkout process.

login (/login)

Login route.

logout (/logout)

Logout route.

navigation

Route for displaying navigation pages, for example categories and menus.

product

Route for displaying products.

CONFIGURATION

The template for each route type can be configured:

    plugins:
      Interchange6::Routes:
        account:
          login:
            template: login
            uri: login
            success_uri:
          logout:
            template: logout
            uri: logout
        cart:
          template: cart
          uri: cart
          active: 1
        checkout:
          template: checkout
          uri: checkout
          active: 0
        navigation:
          template: listing
        product:
          template: product

This sample configuration shows the current defaults.

HOOKS

The following hooks are available to manipulate the values passed to the templates:

before_product_display

The hook sub receives a hash reference, where the Product object is the value of the product key.

before_cart_display
before_checkout_display
before_navigation_display

The hook sub receives the navigation data as hash reference. The list of products is the value of the products key.

before_login_display

EXAMPLES

Disable parts of layout on the login view:

    hook 'before_login_display' => sub {
        my $tokens = shift;

        $tokens->{layout_noleft} = 1;
        $tokens->{layout_noright} = 1;
    };
syntax highlighting: