7.1
Table Of Contents
- Table of Content
- Overview
- Understanding PrintShop Mail Web
- Getting Started
- The PrintShop Mail Web Interface
- Publishing Workflow
- Ordering Workflow
- New Document
- Order Manager
- Checkout
- Companies
- Users
- Publication Types
- Collections
- Settings
- About
- License
- Roles
- Languages
- Web Design
- Maintenance
- Settings
- Currencies
- Tax Rates
- Shipping Rates
- Calendar
- Production Settings
- User Input Field Defaults
- Output Folders
- Job options
- Printers
- E-mail Settings
- E-mail Addressees
- Managing E-mail Templates
- Modules Settings
- Enabling a MIS connector
- Installed modules
- Properties
- Enabling a Print Production connector
- Installed modules
- Properties
- Requirements
- Configuring the module
- The PayPal Sandbox
- Processing orders
- Requirements
- Configuring the Authorize.net module
- Test mode
- AVS and CCV checks
- Payment page
- Requirements
- Requesting a test account
- Configuring the iDEAL test dashboard
- Configuring the iDeal module
- Requirements
- Configuring the Moneris module
- Test mode
- Requesting a live account
- AVS and CVD checks
- Payment page
- Add a new Module
- Configure a module
- Delete a Module
- XML (eXtensible Markup Language)
- Options
- Sample POST receive script
- Interaction With PrintShop Mail Design
- Introduction to Regular Expressions
- Introduction
- Skinning Guide
- Getting started
- Creating your own skin
- The template file
- HMTL Outline
- Styling
- Key Concepts
- Style organization
- Header
- User information
- Menu bar
- Background
- Overview tables
- Edit forms
- Sub menus
- Special variables
- Variables for template files
- Variables for style files
- Creating page exceptions
- Creating a page specific template file
- Modifying a page specific template file
- DOM manipulation using jQuery
- Launching code on Document Ready
- Populating fields with computed values
- Removing elements from the DOM
- Adding information to the DOM
- Customizing the store front
- Storefront class
- Creating a hierarchical tree
- Adding a live search option
- Copyright Information
- Index
Creating a hierarchical tree
This example explains how to replace the default thumbnail view of the store front with a hierachical tree view. The example
combines PHP, CSS and makes use of the Treeview plugin for jQuery to hide and show branches of a tree.
To install the example copy the template-storefront_overview.php from the storefront_tree_template folder to the root of the
default skin.
The store front using a hierarchical view (tree view).
The sample file contains links to external Javascript files and some custom code to generate the actual tree.
The Javascript file
This is the Javascript code stored in the feil "tree.js":
$(document).ready( function(){
$("ul.filetree").treeview({
collapsed: true
});
The code invokes the Treeview plugin once the browser has finished loading the page. The Treeview pluging uses a standard
HTML <ul> element (unordered list) to render the tree.
The template file
The actual code that retrieves the publication type and document list is placed in the contect block of the template file (tem-
plate-storefront_overview.php). The first section instantiates the Storefront. The getTree() returns a hierachical array of the
publication types and documents. In the following section we will access each array item using the foreach function of PHP.
//Retrieve the publication types and templates for the logged on user
$storeFront = New Storefront();
$treeData = $storeFront->getTree();
Once the publication type and document information is collected in a PHP array we need to iterate through the array values.
For this we use a PHP foreach loop. Within this function a custom PHP function (renderPublicationType) is called to generate
the actual HTML.
©2010 Objectif Lune Inc - 257 -