Skillnad mellan versioner av "Templating:Variables"
Från Vendre Help
(→Boxes) |
(→Information page list) |
||
| Rad 185: | Rad 185: | ||
|} | |} | ||
|} | |} | ||
| + | ===Language list=== | ||
| + | {| class="wikitable" | ||
| + | !Variable name | ||
| + | !Type | ||
| + | !Description | ||
| + | !Format | ||
| + | |- | ||
| + | |boxes.languages.list | ||
| + | |list of dictionaries | ||
| + | |Lists all languages | ||
| + | | | ||
| + | {| class="wikitable" | ||
| + | !Key | ||
| + | !Type | ||
| + | !Description | ||
| + | |- | ||
| + | |name | ||
| + | |string | ||
| + | |Language name | ||
| + | |- | ||
| + | |href | ||
| + | |string | ||
| + | |Link to page that sets language to this one | ||
| + | |- | ||
| + | |image | ||
| + | |string | ||
| + | |Image (flag) for language if available | ||
| + | |} | ||
| + | |} | ||
| + | ===Login box=== | ||
| + | {| class="wikitable" | ||
| + | !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=== | ||
| + | {| class="wikitable" | ||
| + | !Variable name | ||
| + | !Type | ||
| + | !Description | ||
| + | !Format | ||
| + | |- | ||
| + | |boxes.news.list | ||
| + | |list of dictionaries | ||
| + | |Lists recent news. Limit set in administration | ||
| + | | | ||
| + | {| class="wikitable" | ||
| + | !Key | ||
| + | !Type | ||
| + | !Description | ||
| + | |- | ||
| + | |name | ||
| + | |string | ||
| + | |News name | ||
| + | |- | ||
| + | |href | ||
| + | |string | ||
| + | |Link to news page | ||
| + | |- | ||
| + | |summary | ||
| + | |string | ||
| + | |News summary | ||
| + | |} | ||
| + | |} | ||
| + | ===News list=== | ||
| + | {| class="wikitable" | ||
| + | !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 | ||
| + | | | ||
| + | {| class="wikitable" | ||
| + | !Key | ||
| + | !Type | ||
| + | !Description | ||
| + | |- | ||
| + | |product_name | ||
| + | |string | ||
| + | |Name of product | ||
| + | |- | ||
| + | |product_image | ||
| + | |string | ||
| + | |Link to product image | ||
| + | |- | ||
| + | |review_href | ||
| + | |string | ||
| + | |Link to full review | ||
| + | |- | ||
| + | |review_rating | ||
| + | |string | ||
| + | |Rating | ||
| + | |- | ||
| + | |review_text | ||
| + | |string | ||
| + | |Text of review | ||
| + | |} | ||
| + | |} | ||
| + | |||
===VAT select box=== | ===VAT select box=== | ||
{| class="wikitable" | {| class="wikitable" | ||
Versionen från 6 april 2011 kl. 16.36
Innehåll
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 |
|
News list
| 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 |
|
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 |
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 |