Skillnad mellan versioner av "Templating:Variables"
Från Vendre Help
Philip (Diskussion | bidrag) (→Page specific: account_newsletters.html) |
Philip (Diskussion | bidrag) (modules/downloads.html) |
||
| Rad 559: | Rad 559: | ||
|N/A | |N/A | ||
|} | |} | ||
| + | |||
| + | ==Modules== | ||
| + | |||
| + | ===downloads.php=== | ||
| + | {| class="wikitable" | ||
| + | !Variable name | ||
| + | !Type | ||
| + | !Description | ||
| + | !Format | ||
| + | |- | ||
| + | |downloads.downloads | ||
| + | |list of dictionaries | ||
| + | |Available downloads | ||
| + | | | ||
| + | {| class="wikitable" | ||
| + | !Key | ||
| + | !Type | ||
| + | !Description | ||
| + | |- | ||
| + | |href | ||
| + | |URL | ||
| + | |Download link | ||
| + | |- | ||
| + | |expiry | ||
| + | |string | ||
| + | |Download expiry date | ||
| + | |- | ||
| + | |valid | ||
| + | |boolean | ||
| + | |Is the download valid? | ||
| + | |- | ||
| + | |download_count | ||
| + | |integer | ||
| + | |Download count | ||
| + | |- | ||
| + | |product_name | ||
| + | |string | ||
| + | |Product name | ||
| + | |} | ||
| + | |- | ||
| + | |downloads.account_history_info | ||
| + | |boolean | ||
| + | |Is this module included from the order info page? | ||
| + | |N/A | ||
| + | |- | ||
| + | |downloads.account_href | ||
| + | |URL | ||
| + | |A link to the account page. | ||
| + | |N/A | ||
| + | |} | ||
| + | |||
==Page specific== | ==Page specific== | ||
Versionen från 3 juni 2011 kl. 13.44
Innehåll
- 1 Variables
- 1.1 Globals
- 1.2 Boxes
- 1.3 Containboxes
- 1.4 Modules
- 1.5 Page specific
- 1.5.1 Contact us page (contact.html)
- 1.5.2 Manufacturers page (manufacturers.html)
- 1.5.3 Kolli page (kolli.html)
- 1.5.4 Log off page (logoff.html)
- 1.5.5 Password forgotten page (password_forgotten.html)
- 1.5.6 Cookie usage page (cookie_usage.html)
- 1.5.7 Advanced search page (advanced_search.html)
- 1.5.8 Login page (login.html)
- 1.5.9 Account page (account.html)
- 1.5.10 Account history page (account_history.html)
- 1.5.11 Order info page (account_history_info.html)
- 1.5.12 Tell a friend page (tell_a_friend.html)
- 1.5.13 Question about product page (question_about_product.html)
- 1.5.14 Change account password page (account_password.html)
- 1.5.15 New account password page (account_password_new.html)
- 1.5.16 Account newsletter subscription page (account_newsletters.html)
Variables
Templates get variables containing all necessary data passed from the back end. This is a complete reference of all available variables.
Globals
Globals are accessible anywhere in the templates, including macros.
| Variable name | Type | Description | Format | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| current_page | string | Contains URL after domain name and before ?, for example storedomain.com/p/digital-fotoram/nextbase-photomil-8wi-fi-fotoram.html?vat_disp=0 returns /p/digital-fotoram/nextbase-photomil-8wi-fi-fotoram.html | N/A | ||||||||||||||||||||||||||||||||||||||||||
| current_script | string | Contains filename of current page | index.php | ||||||||||||||||||||||||||||||||||||||||||
| request | dictionary | A dictionary of recieved GET and POST data |
| ||||||||||||||||||||||||||||||||||||||||||
| current_customer_id | integer | Returns customer ID if customer is logged in, else None | N/A | ||||||||||||||||||||||||||||||||||||||||||
| settings | dictionary | Contains some of the settings defined in the administration |
|
Boxes
Boxes are variables used for the side boxes. They are all prefixed with boxes.
Category menu
| Variable name | Type | Description | Format | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| boxes.categories.tree | list of dictionaries | Contains a tree of displayed categories in menu |
|
Manufacturer select
| Variable name | Type | Description | Format | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| boxes.manufacturers.list | list of dictionaries | Lists all available manufacturers |
|
Search box
| Variable name | Type | Description | Format |
|---|---|---|---|
| boxes.search.advanced_href | string | URL to advanced search page | N/A |
| boxes.search.advanced_result_href | string | Action URL for search form | N/A |
Information page list
| Variable name | Type | Description | Format | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| boxes.information_pages.list | list of dictionaries | Lists all active information pages |
|
Language list
| Variable name | Type | Description | Format | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| boxes.languages.list | list of dictionaries | Lists all languages |
|
Login box
| Variable name | Type | Description | Format |
|---|---|---|---|
| boxes.login.form_href | string | Action link for login form | N/A |
| boxes.login.password_forgotten_href | string | Link to retrieve forgotten password page | N/A |
| boxes.login.account_history_href | string | Link to current customer's account history page. Contains orders and such | N/A |
| boxes.login.account_href | string | Link to current customer's account page | N/A |
| boxes.login.account_password_href | string | Unknown | N/A |
| boxes.login.logoff_href | string | Link to log off current customer | N/A |
| boxes.login.customer_first_name | string | Current customer's first name | N/A |
| boxes.login.customer_last_name | string | Current customer's last name | N/A |
News list
| Variable name | Type | Description | Format | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| boxes.news.list | list of dictionaries | Lists recent news. Limit set in administration |
|
Review
| Variable name | Type | Description | Format | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| boxes.reviews.write_review_href | string | Link to write review page. Only set if customer is viewing a product page | N/A | ||||||||||||||||||
| boxes.reviews.product | dictionary | Product and review data |
|
Shopping cart
| Variable name | Type | Description | Format | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| boxes.shopping_cart.list | list of dictionaries | List of products in shopping cart |
| ||||||||||||||||||||||||||||||||||||
| boxes.shopping_cart.total | string | Total value of contents of shopping cart represented as a string with currency symbol | N/A |
Random special offer
Contains a random special offer.
| Variable name | Type | Description | Format | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| boxes.special_offers.product | dictionary | True if prices are displayed including VAT, else false. |
|
VAT select box
| Variable name | Type | Description | Format |
|---|---|---|---|
| boxes.vat_select.display_with_vat | boolean | True if prices are displayed including VAT, else false. | N/A |
| boxes.vat_select.with_href | string | URL to page where VAT display is set to true. | N/A |
| boxes.vat_select.without_href | string | URL to page where VAT display is set to false. | N/A |
Containboxes
Available in login.html and create_account.html.
Create account box (containboxes/create_account.html)
| Variable name | Type | Description | Format |
|---|---|---|---|
| containboxes.create_account.form_action | URL | A link to the page which handles the form | N/A |
| containboxes.create_account.text | HTML | Box text | N/A |
| containboxes.create_account.generated_password | string | A randomly generated password | N/A |
| containboxes.create_account.customers_personnummer | string | The customer's personnummer | N/A |
| containboxes.create_account.sms_avisering | boolean | N/A | N/A |
| containboxes.create_account.countries | association list | A list of country names mapped to their indices. | Array of string to integer mappings. |
Login box (containboxes/login_box.html)
| Variable name | Type | Description | Format |
|---|---|---|---|
| containboxes.login_box.form_action | URL | A link to the page which handles the form | N/A |
Password forgotten box (containboxes/password_forgotten_box.html)
| Variable name | Type | Description | Format |
|---|---|---|---|
| containboxes.password_forgotten_box.form_action | URL | A link to the page which handles the form | N/A |
Modules
downloads.php
| Variable name | Type | Description | Format | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| downloads.downloads | list of dictionaries | Available downloads |
| ||||||||||||||||||
| downloads.account_history_info | boolean | Is this module included from the order info page? | N/A | ||||||||||||||||||
| downloads.account_href | URL | A link to the account page. | N/A |
Page specific
Most variables are not available on a global scale. They are page specific variables. They are always prefixed with the same name as the included template. So contact.html variables are prefixed with contact.
Contact us page (contact.html)
| Variable name | Type | Description | Format |
|---|---|---|---|
| contact.form_href | string | URL with target of form for handling user input data | N/A |
| contact.captcha | boolean | Determines whether Captcha should be used or not | N/A |
| contact.name | String | Contains customer name if customer is logged in or validation if validation of a field failed | N/A |
| contact.email | string | Contains customer e-mail if customer is logged in or validation if validation of a field failed | N/A |
| contact.heading | string | Contains heading text | N/A |
| contact.text | string | Contains a descriptive text of what the contact us page is. It most certainly contains HTML so the raw filter may be appropriate to use | N/A |
Manufacturers page (manufacturers.html)
| Variable name | Type | Description | Format |
|---|---|---|---|
| id | string | N/A | N/A |
| name | string | N/A | N/A |
| image | string | N/A | N/A |
| address | string | N/A | N/A |
| postcode | string | N/A | N/A |
| postal_address | string | N/A | N/A |
| visitational_address | string | N/A | N/A |
| country | string | N/A | N/A |
| telephone1 | string | N/A | N/A |
| telephone2 | string | N/A | N/A |
| fax | string | N/A | N/A |
| email_address | string | N/A | N/A |
| orgno | string | N/A | N/A |
| vat | string | N/A | N/A |
| note | string | N/A | N/A |
| postgiro | string | N/A | N/A |
| bankgiro | string | N/A | N/A |
| contact | string | N/A | N/A |
| payment_conditions | string | N/A | N/A |
| customers_no | string | N/A | N/A |
| homepage | string | N/A | N/A |
| link | string | N/A | N/A |
Kolli page (kolli.html)
| Variable name | Type | Description | Format |
|---|---|---|---|
| kolli.heading | string | Page heading | N/A |
| kolli.text | HTML | Page text | N/A |
Log off page (logoff.html)
| Variable name | Type | Description | Format |
|---|---|---|---|
| logoff.continue_href | string | Link presented to the user after logging off. | N/A |
Password forgotten page (password_forgotten.html)
| Variable name | Type | Description | Format |
|---|---|---|---|
| password_forgotten.form_action | string | A link to the page which handles the form | N/A |
| password_forgotten.back_href | string | A link to the parent page (login.php) | N/A |
Cookie usage page (cookie_usage.html)
| Variable name | Type | Description | Format |
|---|---|---|---|
| cookie_usage.continue_href | string | A link to the next page (index.php) | N/A |
Advanced search page (advanced_search.html)
| Variable name | Type | Description | Format |
|---|---|---|---|
| advanced_search.form_action | string | A link to the page which handles the form. | N/A |
| advanced_search.categories | association list | A list of category names mapped to their indices. | Array of string to integer mappings. |
| advanced_search.manufacturers | association list | A list of manufacturer names mapped to their indices. | Array of string to integer mappings. |
Login page (login.html)
| Variable name | Type | Description | Format |
|---|---|---|---|
| login.heading | string | Page heading | N/A |
Account page (account.html)
| Variable name | Type | Description | Format | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| account.account_history_href | URL | N/A | ||||||||||||||||||||||
| account.account_edit_href | URL | N/A | ||||||||||||||||||||||
| account.address_book_href | URL | N/A | ||||||||||||||||||||||
| account.account_password_href | URL | N/A | ||||||||||||||||||||||
| account.logoff_href | URL | N/A | ||||||||||||||||||||||
| account.account_newsletters_href | URL | N/A | ||||||||||||||||||||||
| account.account_notifications_href | URL | N/A | ||||||||||||||||||||||
| account.order_history_enabled | boolean | Is the order history enabled? | N/A | |||||||||||||||||||||
| account.order_history | list of dictionaries | Order history |
|
Account history page (account_history.html)
| Variable name | Type | Description | Format | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| account_history.account_href | URL | N/A | ||||||||||||||||||||||||||||
| account_history.page_count | integer | Number of pages for pagination | N/A | |||||||||||||||||||||||||||
| account_history.page_links | HTML | Links for pagination | N/A | |||||||||||||||||||||||||||
| account_history.order_history | list of dictionaries | Order history |
|
Order info page (account_history_info.html)
| Variable name | Type | Description | Format | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| account_history_info.back_href | URL | Link back to the account order history | N/A | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| account_history_info.order | dictionary | Order info |
|
Tell a friend page (tell_a_friend.html)
| Variable name | Type | Description | Format |
|---|---|---|---|
| tell_a_friend.form_action | URL | A link to the page which handles the form | N/A |
| tell_a_friend.back_href | URL | Link back to the product page | N/A |
| tell_a_friend.product_name | string | Product name | N/A |
Question about product page (question_about_product.html)
| Variable name | Type | Description | Format |
|---|---|---|---|
| question_about_product.form_action | URL | A link to the page which handles the form | N/A |
| question_about_product.back_href | URL | Link back to the product page | N/A |
| question_about_product.product_name | string | Product name | N/A |
Change account password page (account_password.html)
| Variable name | Type | Description | Format |
|---|---|---|---|
| account_password.form_action | URL | A link to the page which handles the form | N/A |
| account_password.back_href | URL | Link back to the account page | N/A |
New account password page (account_password_new.html)
| Variable name | Type | Description | Format |
|---|---|---|---|
| account_password_new.form_action | URL | A link to the page which handles the form | N/A |
| account_password_new.back_href | URL | Link back to the account page | N/A |
| account_password_new.password_provided | boolean | Is a password provided by the user, or the default password | N/A |
Account newsletter subscription page (account_newsletters.html)
| Variable name | Type | Description | Format |
|---|---|---|---|
| account_newsletters.form_action | URL | A link to the page which handles the form | N/A |
| account_newsletters.back_href | URL | Link back to the account page | N/A |
| account_newsletters.subscribed | boolean | Is the user subscribed to the newsletter | N/A |