This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
designers:template_error [2012/04/09 23:33] jonyo created |
designers:template_error [2016/02/01 10:32] (current) rafael |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | {{indexmenu_n> |
+ | ====== | ||
+ | The Geo software extends the [[http:// | ||
- | If you get this error: | + | The plugins are divided into different sections: |
- | Oops! Template Error! Please pardon our dust as we work to update the site... | + | ====== Resources ====== |
- | That indicates | + | In Smarty, |
- | Automated Admin Notice: TEMPLATE ERROR! | + | ===== geo_tset resource ===== |
- | The e-mail will look something like the below. | + | Added in **Version 6.0.0**. |
- | ===== Sample E-Mail Contents ===== | + | This resource makes the // |
- | < | + | See [[admin_menu/design/template_sets/start# |
- | <hr /> | + | |
- | You are receiving this because a template error was generated on your site:<br /> | + | |
- | < | + | |
- | <br /><br />See below for template error details:< | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | </ | + | |
- | <br /><br /> | + | |
- | < | + | |
- | troubleshoot. | + | |
- | <br /><br />< | + | |
- | Stack trace: | + | |
- | #0 / | + | |
- | ........ | + | |
- | </ | + | |
- | ... | + | |
- | <hr /> | + | |
- | </ | + | ====== Block Functions ====== |
- | The rest of the e-mail has not been included for brevity((Plus you only need what is listed in the big red box, the rest you can usually just ignore.)) | + | In a Smarty template, a block function is a block of the template surrounded by special Smarty tags, something like: |
+ | <code html> | ||
- | ===== How to Fix ===== | + | This has a few different uses. Currently there is only one custom block function but there may be more added in future versions. |
- | The **only part** you need to read, is the stuff in the **big red box**. | + | ===== {add_footer_html} ===== |
- | Now, say you got the e-mail contents from [[#Sample E-Mail Contents]] above. | + | Added in **Version 7.3.0**. |
- | If you read the actual error message, it states " | + | The **{add_footer_html}** block is used to move the contents inside |
- | The "fix" would be to remove | + | Any time that you insert JS into a template in-line, if the JS uses jQuery, jQuery-UI, or any of the "built in" JS, it will need to use the {add_footer_html} block in order to work correctly when the above mentioned setting is turned on. And the JS needs to be coded such that it does not need to be in that exact location within the template, it "can be" or it could be moved to the end depending on settings. |
+ | |||
+ | **Typical Usage:** | ||
+ | <code html> | ||
+ | <script type=" | ||
+ | //Some JS that uses something "built in" like jQuery, the gjUtil object, the geoUtil | ||
+ | //object, jQuery UI, etc. | ||
+ | </ | ||
+ | {/ | ||
+ | |||
+ | |||
+ | **Required Parameters: | ||
+ | * There are no required parameters. < | ||
+ | |||
+ | |||
+ | **Standard Optional Parameters: | ||
+ | * There are no standard optional parameters. < | ||
+ | |||
+ | |||
+ | **Non-Standard Optional Parameters: | ||
+ | * There are no non-standard optional parameters < | ||
+ | |||
+ | |||
+ | ====== Functions ====== | ||
+ | |||
+ | In a Smarty template, a template function is a special tag that looks something like: | ||
+ | <code html> | ||
+ | |||
+ | See [[http:// | ||
+ | |||
+ | ===== {body_html} ===== | ||
+ | |||
+ | The **{body_html}** is used to display the content specific for the current page being displayed. | ||
+ | |||
+ | This custom function behaves very similarly to the built-in **{include ...}** function, except that it uses a system template to display the contents((There are special cases, such as extra pages, listing details, and any pages created by addons.)). | ||
+ | |||
+ | **Typical Usage:** | ||
+ | < | ||
+ | |||
+ | |||
+ | **Required Parameters: | ||
+ | * There are no required parameters. < | ||
+ | |||
+ | |||
+ | **Standard Optional Parameters: | ||
+ | * There are no standard optional parameters. < | ||
+ | |||
+ | |||
+ | **Non-Standard Optional Parameters: | ||
+ | * **file** - **Added in Version 6.0.0**. | ||
+ | * **g_type** - **Added in Version 6.0.0**. | ||
+ | * **g_resource** - **Added in Version 6.0.0**. | ||
+ | * **assign** - **Added in Version 6.0.0**. | ||
+ | * Variables - Any other parameters used in the tag, will over-write the same-named body_html variables that are set by the script, much like the effect of adding extra parameters to an {include ...} tag. < | ||
+ | |||
+ | |||
+ | |||
+ | ===== {head_html} ===== | ||
+ | |||
+ | Added in **Version 7.3.0** | ||
+ | |||
+ | In version 7.3.0, we re-named the old {header_html} tag to be {head_html} instead. | ||
+ | |||
+ | We just thought if the tag goes inside the < | ||
+ | |||
+ | Note that the old {header_html} will continue to work for the forseeable future. | ||
+ | |||
+ | See [[# | ||
+ | |||
+ | ===== {header_html} ===== | ||
+ | |||
+ | The **{header_html}** is used to display any HTML that needs to be included in the < | ||
+ | |||
+ | One question we get a lot is what template is used to display the {header_html} or what PHP file generates the contents. | ||
+ | |||
+ | **Typical Usage: | ||
+ | < | ||
+ | |||
+ | |||
+ | **Required Parameters: | ||
+ | * There are no required parameters. < | ||
+ | |||
+ | |||
+ | **Standard Optional Parameters: | ||
+ | * There are no standard optional parameters. < | ||
+ | |||
+ | |||
+ | **Non-Standard Optional Parameters: | ||
+ | * **file** - **Added in Version 6.0.0**. | ||
+ | * **g_type** - **Added in Version 6.0.0**. | ||
+ | * **g_resource** - **Added in Version 6.0.0**. | ||
+ | * **assign** - **Added in Version 6.0.0**. | ||
+ | * Variables - Any other parameters used in the tag, will over-write the same-named header_html variables | ||
+ | |||
+ | |||
+ | ===== {footer_html} ===== | ||
+ | |||
+ | Added in **Version 7.3.0** | ||
+ | |||
+ | The **{footer_html}** | ||
+ | |||
+ | Normally all of the JS for the page used by the system, such as the JS that makes the lightbox work, is loaded by {head_html} inside the < | ||
+ | |||
+ | So in other words, the {footer_html} is basically the parts of the {head_html} tag that can be " | ||
+ | |||
+ | **Typical Usage: | ||
+ | < | ||
+ | |||
+ | |||
+ | **Required Parameters: | ||
+ | * There are no required parameters. < | ||
+ | |||
+ | |||
+ | **Standard Optional Parameters: | ||
+ | * There are no standard optional parameters. < | ||
+ | |||
+ | |||
+ | **Non-Standard Optional Parameters: | ||
+ | * **file** - You can over-write what file is normally used to display the header_html contents. | ||
+ | * **g_type** - Over-write the template type (system, module, addon, external, or main_page) by specifying **g_type=' | ||
+ | * **g_resource** - Over-write the g_resource, which is basically the "top folder" | ||
+ | * **assign** - Allows assigning the output to the variable specified. < | ||
+ | * Variables - Any other parameters used in the tag, will over-write the same-named footer_html variables that are set by the script, much like the effect of adding extra parameters to an {include ...} tag. < | ||
+ | |||
+ | |||
+ | **See Also:** The [[# | ||
+ | |||
+ | |||
+ | ===== {addon} ===== | ||
+ | |||
+ | The **{addon ...}** tag displays the contents of a tag generated by an addon. | ||
+ | |||
+ | **Typical Usage:** | ||
+ | < | ||
+ | |||
+ | **Requires Attachment: | ||
+ | Addon tags are attached to **main_page templates**((Note that **only main_page templates** are able to have attachments. | ||
+ | |||
+ | <tip c t> | ||
+ | |||
+ | **Required Parameters: | ||
+ | * **author** - This should be set to the addon' | ||
+ | * **addon** - The addon' | ||
+ | * **tag** - The tag name for which tag to display. | ||
+ | |||
+ | **Standard Optional Parameters: | ||
+ | * **headOnly** - **Added in Version 6.0.0** Set this parameter to 1 to make it so that only the header stuff is added, the addon tag itself is not displayed. | ||
+ | |||
+ | **Non-Standard Optional Parameters: | ||
+ | * **g_type** - **Added in Version 6.0.0**. | ||
+ | * **g_resource** - **Added in Version 6.0.0**. | ||
+ | * **assign** - **Added in Version 6.0.0**. | ||
+ | * Other: | ||
+ | * Template Variables - **Only used if** the addon tag uses the built-in template methods to display the tag contents. | ||
+ | * Other parameters - See the addon tag documentation. | ||
+ | |||
+ | ===== {external} ===== | ||
+ | |||
+ | The **{external ...}** tag will display the URL for the requested external file, such as an image, CSS, or JS file located in the external/ folder in a template set. | ||
+ | |||
+ | <tip c t> | ||
+ | |||
+ | See [[admin_menu/ | ||
+ | |||
+ | **Typical Usage:** | ||
+ | < | ||
+ | |||
+ | **Required Parameters: | ||
+ | * **file** - What file to look for in the external folder in each of the template sets. < | ||
+ | |||
+ | **Standard Optional Parameters: | ||
+ | * There are no standard optional parameters. < | ||
+ | |||
+ | **Non-Standard Optional Parameters: | ||
+ | * There are no non-standard optional parameters for this tag. < | ||
+ | |||
+ | ===== {module} ===== | ||
+ | |||
+ | The **{module ...}** tag will display the specified built-in module. | ||
+ | |||
+ | **Typical Usage:** | ||
+ | < | ||
+ | |||
+ | <tip c t> | ||
+ | |||
+ | **Requires Attachment: | ||
+ | Addon tags are attached to **main_page templates**((Note that **only main_page templates** are able to have attachments. | ||
+ | |||
+ | **Required Parameters: | ||
+ | * **tag** - The tag name used by the module you want to display. < | ||
+ | |||
+ | **Standard Optional Parameters: | ||
+ | * There are no standard optional parameters. < | ||
+ | |||
+ | **Non-Standard Optional Parameters: | ||
+ | * **assign** - **Added in Version 6.0.0**. | ||
+ | * Template Variables - Any other parameters used in the tag, will over-write | ||
+ | * **browse_tpl** : Added in **Version 7.1.0**: | ||
+ | < | ||
+ | * Module Settings - **(As of Version 7.0.2)** Any module setting, which is normally set in the admin panel, is able to be overridden by a tag parameter. | ||
+ | |||
+ | **Module Settings** (requires **version 7.0.2 or higher** to work) | ||
+ | |||
+ | **When to Use: | ||
+ | |||
+ | ^ Setting ^ Valid Values ^ Module(s) Used For ^ Description ^ | ||
+ | | browse_view | Text: either ' | ||
+ | | module_number_of_ads_to_display | Number (like " | ||
+ | | module_display_header_row | 1 (on) or 0 (off) | Any that display listings | Shows column headers and/or module title above | | ||
+ | | module_display_ad_description | 1 (on) or 0 (off) | Any category navigation | Despite the name, it is on/off for whether to show the " | ||
+ | | module_display_ad_description_where | 1 (on) or 0 (off) | Any that display listings in grid view | Whether to show description under title (1) or on it's own column (0) | | ||
+ | | module_file_name | Valid PHP file name in modules folder | All | Should not use! Well OK you can use it, if for instance you had your own custom module file to use instead of the built in one. Not recommended though, you probably want to make a custom addon tag instead. | | ||
+ | | module_replace_tag | DO NOT USE | All | Do Not Use! May cause rip in space-time continuum!((Seriously, | ||
+ | | module_display_username | Number from 1 to 6 | display_username module | Change what info is displayed about the user - 1: username, 2: first name, 3: last name, 4: First name Last Name, 5: Last name First name 6: Email | | ||
+ | | module_thumb_width | Number | Any showing listings with images | Controls max thumbnail **width**. | ||
+ | | module_thumb_height | Number | Any showing listings with images | Controls max thumbnail **height**. | ||
+ | | module_number_of_columns | Number | Featured pic modules | Number of columns to use. | | ||
+ | | module_category_level_to_display | 1 (on) or 0 (off) | Category level navigation | Switch to make it show one category below top level, sort of special case for site set up a specific way. | | ||
+ | | module_category | Number | Category navigation | The category ID to start out in for category navigation. | | ||
+ | | cat_id | Number | Any showing listings | Show only listings in specified category ID or subcategories((Note: | ||
+ | | not_cat_id | Number | Any showing listings | Show only listings **NOT** in specified category ID or sub-categories((Note: | ||
+ | | module_display_new_ad_icon | 1 (on) or 0 (off) | Category navigation | Whether to display the new ad icon or not. | | ||
+ | | module_display_type_listing | Number: 0, 1, 2, or 4 | Any that display listings | What type of listings to show: 0: all, 1: classifieds only, 2: any auction type, 4: only reverse auctions | | ||
+ | | module_display_type_text | 1 (on) or 0 (off) | Any that display listings | Whether to show the listing type icon or not | | ||
+ | | module_display_sub_category_nav_links | 1 (on) or 0 (off) | Category navigation | Whether to show sub-categories or not. | | ||
+ | | photo_or_icon | 0 (icon), 1 (thumbnail) or 2 (site default) | Any showing listings | Whether to show icon or thumbnail | | ||
+ | | use_pagination | 1 (on) or 0 (off) | Any showing listings | If on, will add AJAX pagination to the module, allowing extra listings beyond the first set to be loaded without reloading the page | | ||
+ | ===== {listing} ===== | ||
+ | |||
+ | Added in **Version 7.1.0**. | ||
+ | |||
+ | The **{listing ...}** tag displays blocks of information about a listing. | ||
+ | |||
+ | It can also be used anywhere in any template, even when not browsing or not on listing details, as long as you specify the **listing_id** parameter in the tag so that it knows what listing to use. | ||
+ | |||
+ | <tip c t> | ||
+ | |||
+ | **Typical Usage examples: | ||
+ | * Standard listing **tag** < | ||
+ | * Standard listing **field** < | ||
+ | * Standard listing **addon tag** < | ||
+ | |||
+ | **Advanced Usage Examples: | ||
+ | * Assign array of listing tags to template var $these_listing_tags: | ||
+ | * Assign the pre-currency symbol **unformatted** to the template var $precurrency_raw: | ||
+ | * Assign the category questions, and display the value for question with ID of 123((You | ||
+ | {if $questions.123} | ||
+ | {* only display if question with ID 123 exists *} | ||
+ | < | ||
+ | < | ||
+ | {if $questions.123.value} | ||
+ | {* This is a standard value *} | ||
+ | {$questions.123.value} | ||
+ | {elseif $questions.123.link} | ||
+ | {* This is a URL question, so make it use a link *} | ||
+ | <a href=" | ||
+ | {/if} | ||
+ | {/ | ||
+ | |||
+ | |||
+ | **Required Parameters: | ||
+ | * **tag** - What tag to show. Tags typically take some data attached to the listing, and display it in a friendly way. For instance, the // | ||
+ | * **field** - What listing field to display. | ||
+ | |||
+ | |||
+ | |||
+ | **Standard Optional Parameters: | ||
+ | * **addon** - Requires using **tag** parameter, does not work with field. | ||
+ | * **format** - Requires using **field** parameter. | ||
+ | * **format=' | ||
+ | * **format=' | ||
+ | * listing((entire array of listing info for the listing un-formatted))< | ||
+ | * tags((the listing tags/ | ||
+ | * order_items((That' | ||
+ | * images< | ||
+ | * seller< | ||
+ | * high_bidder - Added in **Version 7.1.1** ((This will only work with auctions that have at least one bid. This will include both the bid information, | ||
+ | * multi_level_fields (or " | ||
+ | * regions - includes " | ||
+ | * extra_questions - Added in **Version 7.2.1** ((This will give an array in the format <code php> | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ));</ | ||
+ | * checkboxes - Added in **Version 7.2.1**< | ||
+ | < | ||
+ | < | ||
+ | * **listing_id** - Used to force it to use the specified listing. | ||
+ | |||
+ | |||
+ | **Non-Standard Optional Parameters: | ||
+ | * **file** - You can over-write what file is normally used to display the tag contents.((Note that some addon tags may not use this, as it depends on how the addon' | ||
+ | * **g_type** - Over-write the template type (system, module, addon, external, or main_page) by specifying **g_type=' | ||
+ | * **g_resource** - Over-write the g_resource, which is basically the "top folder" | ||
+ | * **assign** - Allows assigning the output to the variable specified.((Note that some addon tags may not use this, as it depends on how the addon' | ||
+ | * Variables - Any other parameters used in the tag, will over-write the same-named template variables that are set by the script for the sub-template used, much like the effect of adding extra parameters to an {include ...} tag.((Note that some addon tags may not use this, as it depends on how the addon' | ||
+ | ==== {debug_templates_used} ==== | ||
+ | |||
+ | Added in **version 6.0.0**. | ||
+ | |||
+ | The {debug_templates_used} displays all template files referenced at all up until the point the tag is inserted. | ||
+ | |||
+ | When you insert the tag, it will display tips and notes above the list, read those for important and useful info about the tag and its usage. | ||
+ | |||
+ | **Special Tag:** Not recommended for live sites: | ||
+ | |||
+ | This tag is made for developers and designers already familiar with the software and how Smarty templates work, to be able to quickly and easily see what templates (including system templates) are used to build a page. It is not intended for live sites. | ||
+ | ====== Modifiers ====== | ||
+ | |||
+ | Modifiers are used to manipulate a variable in some way, for instance the custom modifier **displayPrice** will change something that normally looks like // | ||
+ | |||
+ | ===== displayPrice ===== | ||
+ | |||
+ | This is used to take a number like **1234.56** and display it in price format like **$1,234.56 USD**. | ||
+ | |||
+ | Anything non-numeric will be converted to 0. | ||
+ | |||
+ | **Typical Usage:** | ||
+ | < | ||
+ | Use site-wide settings for pre and post currency. | ||
+ | < | ||
+ | Use specified pre and post currency values instead of site-wide settings. | ||
+ | < | ||
+ | Use site-wide settings for pre and post currency, and specify that the " | ||
+ | |||
+ | **Parameters: | ||
+ | * Parameter 1 - optional - Pre-currency string. | ||
+ | * Parameter 2 - optional - Post-currency string. | ||
+ | * Parameter 2 - optional - Price type, either ' | ||
+ | |||
+ | |||
+ | ===== escape_js ===== | ||
+ | |||
+ | Used to escape a string to be usable inside JS. Replaces any newlines, tabs, or carriage returns with a single space, and adds slashes to escape the string. | ||
+ | |||
+ | **Typical Usage:** | ||
+ | < | ||
+ | |||
+ | **No additional parameters** | ||
+ | |||
+ | ===== format_date ===== | ||
+ | |||
+ | Similar to the Smarty modifier date_format, | ||
+ | |||
+ | **Typical Usage:** | ||
+ | < | ||
+ | Will use the date format as set in the admin settings. | ||
+ | < | ||
+ | Format the date as specified in the first parameter. | ||
+ | < | ||
+ | Display the current time in the format specified in the admin panel settings. | ||
+ | |||
+ | **Parameters: | ||
+ | * Parameter 1 - optional - The date format, should use syntax as described on [[http:// | ||
+ | |||
+ | ===== fromDB ===== | ||
+ | |||
+ | Decodes the a string that was previously encoded to save in the database. | ||
+ | |||
+ | **Typical Usage:** | ||
+ | < | ||
+ | |||
+ | **No additional parameters** | ||
+ | |||
+ | ===== qr_code ===== | ||
+ | |||
+ | Transforms a string (usually a URL) into a QR Code (Requires Geo v6.0.0+) | ||
+ | |||
+ | **Typical Usage:** | ||
+ | < | ||
+ | Will create a QR code with the default parameters (size 100, UTF-8, error correction level ' | ||
+ | < | ||
+ | Will create a physically larger code with more error correction | ||
+ | |||
+ | **Parameters: | ||
+ | * Parameter 1 - optional - integer (default: 100) containing the height and width (its square) of the finished image, in pixels. Note that this INCLUDES a border of whitespace around the code (part of the QR spec). Also note that images much smaller than size 75 or so are not likely to be readable by current smartphones (in testing, an iPhone4 had no problem with size 75, but didn't have enough camera resolution to read size 50) | ||
+ | * Parameter 2 - optional - The character encoding of the original string. This should almost always be ' | ||
+ | * Parameter 3 - optional - The error correction level. One of the following characters: ' |