|
||||||||||||||||
|
|
Section 8. Templates Overview You can place Realestate blocks of code on the page in a random order, as well as select various color schemes for these blocks. This is done by using 100% template-based design of phpRealestate. This section discusses various actions that can be performed in the context of field management. It contains the following topics :
Basic principles of the template system Templates and special tags are the key concepts of the front-end interface. Special tags can be global and local. Let's look at these concepts in greater detail. A template consists of one or more text files that contain a combination of HTML tags and phpRealestate special tags and represent a certain element of the page. Templates do not contain specific information, they just format data on the site. A special tag is a string of a certain type which is processed by the script and replaced with the appropriate value. It can contain either specific information, or a directive to insert a page of another template. So every page consists of a number of templates, and each of them is pre-processed for special tags. Besides, special tags allow nesting of templates . A global special tag is a tag which is processed in any template regardless of the template's purpose or nesting level. A local special tag is a tag which is processed in a specific template. It is rendered as a plain text in other templates. The template system has a well-defined structure. Templates for the English language ( en code ), which is automatically created during the phpRealestate installation, are stored in the following directory: realestate-templates/ en . If you have other languages, then the realestate-templates directory will contain several directories named appropriately. The directory structure of templates is common for all languages (see picture 37).
Here you can see folders that contain templates of elements for global special tags' objects (category, print, property), as well as the mail and default folders. The mail folder contains templates for e-mail messages sent to the administrator when a visitor fills in a contact form on the site. The default folder contains a set of pre-defined templates of real estate major pages. Every language also has the images folder located under /realestate-templates , this folder contains all images that belong to properties. Templates of Real estate major pages The default folder contains the following files:
This is the main template of the set. It is used to browse categories, view nested categories, as well as view the list of properties within a category. This file may contain any HTML code. This template uses only global special tags.
This template corresponds to the page which contains property detailed information. This file can contain any HTML code. This file also contains local special tags to display property's details. This template can also use any global special tags. This page also hosts contact form, which can be used to contact site administrator about a particular property.
This template defines a print version of the page with property detailed information. It is recommended to construct this template as a full HTML page, because it is opened in a new window and is not imbedded into any other template. This template contains local special tags to display property details. Global special tags are not processed in this template.
This template is used to print the list of templates that belong to a certain category. It is recommended to construct this template as a full HTML page, because it is opened in a new window and is not imbedded into any other template. Global special tags are also processed in addition to HTML code. It is enough to place a global special tag with the LIST element of the PROPERTY object in order for this template to function normally.
This template defines the page, which is displayed after a visitor fills in a contact form. This page can contain any HTML code. It can also use any global special tags. As you see, local special tags are only contained in the info and info-print templates. Let's look at them in more detail. #PROP_LANG# - must be used as a value of the hidden field name="lang" of the contact form. #PROP_TPL# - must be used as a value of the hidden field name="tpl" of the contact form. #PROP_ID# - is used as a value of the hidden field name="prop_id" , if you need to specify the values of some property fields in the e-mail template of the contact form. This value is also used in the Java script while viewing property's additional images. #PROP_MAIL_URL# - must be used as a value of the attribute action="#PROP_MAIL_URL#" of the contact form. #PROP_RIDRECT_URL# - must be used as a value of the hidden field name="redirect" of the contact form. #PROP_DATE# - property creation date. #PROP_NAVIGATION_TEMPLATE# - is used to display the list of categories, which contain the property. You must specify the name of the template for this list instead of TEMPLATE. This special tag has its own template. Note that you can use the pre-defined default template instead of TEMPLATE. Templates for the English language are located in the following folder: realestate-templates/en/property/navigation These templates consist of several files. The pre-defined template is located in the following folder: realestate-templates/en/property/navigation/default Let's look at the files that form this template, including its local special tags. navigation_begin – the header of the list, it doesn't contain any local special tags. navigation_end –the footer of the list, it doesn't contain any local special tags. navigation_separator – this template separates categories in the list, it doesn't contain any local special tags. cat_path_begin - the title for a particular category path. This file doesn't contain any local special tags. cat_path_end - the footer for a particular category path. This file doesn't contain any local special tags. cat_path_part - a link to a category from the path. The file contains the following special tags: #CAT_PATH_URL# is replaced with the URL of the page of the appropriate category from the path. #CAT_PATH_NAME# is replaced with the name of the appropriate category from the path. cat_path_separator – separates categories in the path. You can modify the pre-defined template for this element, as well as create your own templates. To add a new template, create a new folder under the / realestate-templates/en/property/navigation folder and create the specified files there. The names of the files must fully match the names mentioned above. To use new templates specify the name of a new folder in the TEMPLATE part of the local special tags in the templates of property detailed information pages. #FIELD_SOMECODE# - is used to display the value of the field with a specified code for a particular property. Replace the SOMECODE part with the code of the field which value you would like to display in the appropriate place of the template. This special tag does not have a template. #GROUP_SOMECODE_TEMPLATE# - is used to display a checkbox group with a specified code. Replace the SOMECODE part with the code of a checkbox group that must be displayed in the appropriate place of the template. Replace the TEMPLATE part with the name of the template for a selected group. This special tag has its own template. Note that you can specify the pre-defined default template instead of TEMPLATE. Templates for the English language are located in the following folder: realestate-templates/en/property/checkgroup These templates consist of several files. The pre-defined template is stored in the following folder: realestate-templates/en/property/checkgroup/default Let's look at the files that form this template in greater detail, including its local special tags. check_begin - represents a title of the checkbox group when there is at least one checkbox selected for a particular property in this group. You can put the title of the group using the local special tag #GROUP_NAME#. This title is defined in the Administrator control panel (see Section 6 - Manage fields ). check_row - represents a row of the checkbox group. A group consists of a sequence of rows. The local special tag #CHECK_CELLS# of this template is replaced with the columns of checkboxes selected for a particular property. check_cell - represents a single checkbox. A sequence of columns replaces the local special tag #CHECK_CELLS# in the check_row template. The check_cell template itself contains the following special tags: #CELL_WIDTH# - represents a column width on the page. This value is calculated automatically depending on the number of columns defined for a checkbox group in the Administrator control panel. #NAME# - is replaced with the name of the selected checkbox as it is seen in the Administrator control panel. check_cell_empty - is used for an empty column of the last row when the number of the selected checkboxes is not enough for all columns. #CELL_WIDTH# - represents a column width on the page. This value is calculated automatically depending on the number of columns defined for a group. check_end - represents a footer of a checkbox group. This file does not contain local special tags. check_empty - is used when there are no selected checkboxes in a group for a particular property. Use the local special tag #GROUP_NAME# to display the name of the group. You can modify the pre-defined template, or create your own templates. To add a new template, you need to create a new folder under the realestate-templates/en/property/checkgroup folder and create there the files described above (6 total). The names of the files must fully match the names mentioned earlier. To use new templates you must specify the name of the new folder in the TEMPLATE part of the local special tags for checkbox groups in the property detailed information templates. #EXTRA_IMAGES_TEMPLATE# - is needed to display property additional images. Replace the TEMPLATE part with a template name, because this special tag has its own template. Note that you can use the pre-defined default template instead of the TEMPLATE part. Templates for displaying additional images on the property detailed information page for the English language are stored in the following folder: realestate-templates/en/property/extra-images/ These templates consist of several files. The pre-defined template is stored in the following folder: realestate-templates/en/property/extra-images/default Let's look at the files that form this template in greater detail, including their local special tags. extra_image – is used to display extra images. When you click on a thumbnail image #PROP_EIMG_THMB# the full-sized image #PROP_EIMG_BIG# is inserted by the Java script instead of the image with the ID main_img_#PROP_ID#, which is present in the property detailed information template. These local special tags are absolutely needed in this template in order for the Java script to normally function. Otherwise you will see the Java script error on the property detailed information page. The local special tag #PROP_EIMG_TEXT# is used to insert an image text. #MULTIPLE_SOMECODE_TEMPLATE# - is used to display Multiple type fields with the specified code. The SOMECODE part must contain the code of the Multiple type field to be displayed in the appropriate part of the template. Replace the TEMPLATE part with the name of the template for a Multiple type field. This special tag has its own template. Note that you can use the pre-defined default template instead of the TEMPLATE part. Templates used to display Multiple type fields in the property detailed information template for the English language are stored in the following folder: realestate-templates/en/property/multiple These templates consist of several files. The pre-defined template is stored in the following folder: realestate-templates/en/property/multiple/default Let's look at the files that form this template in more detail, including their local special tags. multiple_begin – represents a header of the field if there is at least one element selected in this field for a particular product. To put the name of the field into this template use the local special tag #MULTIPLE_NAME#. multiple_one – represents one element of the field. Templates of field elements are interleaved with the multiple_separator template. The multiple_one template itself contains one local special tag #ITEM_NAME#, which is replaced with the name of the element. multiple_end – represents a footer of the field, it doesn't contain any local special tags. multiple_empty – used if there are no elements selected in this Multiple type field for a particular property. To put the name of the field into this template use the local special tag #MULTIPLE_NAME#. You can modify the pre-defined template, or create your own templates. To add a new template, you should create a new folder under the realestate-templates/en/property/multiple folder and create there the files listed above (total 4). The names of the files must fully match the names of the above mentioned files. To use the new template you should specify the name of the new folder in the TEMPLATE part of local special tags for Multiple type fields in the property detailed information templates. It makes no sense to keep tags related to the contact form in the print-info file, because its presence on the print version page is not required. The info template acts the opposite way . The value of the name attribute for every field must start with mail_, to insure that data from the contact form fields are placed into the e-mail template. If a visitor must enter his or her e-mail address, this field must have the attribute name="mail_email". Local special tags #MAIL_SOMENAME# will be replaced in the e-mail template with the values of the appropriate fields. In this case you should add the tag #MAIL_EMAIL# to the e-mail template. Note that all letters must be uppercase. The pre-defined e-mail template default for the English language is stored on the following folder: realestate-templates/en/mail This template consists of only one file. The default file is a pre-defined template. You can use this template to create your own templates. To use a new template, specify its name in the value attribute of the hidden field mailtpl in the contact form on the property detailed information page. Local special tags #MAIL_SOMENAME# are replaced with the value entered by the visitor of the site in the contact form, if the field has the following attribute value: name=”MAIL_SOMENAME”. The script also processes local special tags #FIELD_..., #GROUP_..., #MULTIPLE_..., if the contact form has a hidden field name="prop_id" and its value is value="#PROP_ID#". Note that #GROUP_... and #MULTIPLE_... tags are replaced with HTML text. That's why it is a good idea to have special e-mail templates without HTML code. Global special tags Global special tags are processed in any template regardless of its purpose and nesting level . Global special tags have a well-defined unified format: #RE_OBJECT_ELEMENT_TEMPLATE_[PARAMETER]# Global special tags start and end with a pound (#) symbol. Every part of the tag is mandatory, except for the PARAMETER part. All parts of the tag are separated with an underscore ( _ ) symbol . Let's look at global special tags in greater detail. The first part of the tag RE identifies the tag as global for the whole real estate system. The OBJECT part of the tag defines the object that should be displayed in this part of the page. The ELEMENT part of the tag defines the element of the selected object that should be displayed in this part of the page. The TEMPLATE part of the tag defines a template which should be used to display the selected element. When you create a new language, the default template is automatically created for every element of every object. That is why you can always you the default template for the TEMPLATE part of the tag. Some object elements need specific parameters which are defined in the last part of the tag [ PARAMETER] . NOTE: You must always form the tags according to these rules, otherwise they will be treated as a plain text. There are only three objects available: a category, a property and a link to a print version. Accordingly the second part of the special tag - OBJECT - may take one of the following values:
Every object has its own unique set of elements. Let's look at these objects in more detail. The CATEGORY object This object controls the output of all category data, it contains the following elements: The NAVIGATION element represents a category path. A sample category navigation view is displayed on the picture 38. Root > Category1 > Category2
To display category navigation controls, the ELEMENT part of the tag must contain the word NAVIGATION . The TEMPLATE part of the special tag may contain the word default. This template is created automatically with a new language . This special tag also contains one optional parameter - category ID whose path is to be displayed on the page. You can see the category ID in the first column of the list of categories in the Administrator control panel (see Section 4 - Manage categories .). If this parameter is not present, the script displays the path to the current category. If the category ID is not set and a current page is not a page displaying the content of any category, the path will only contain the root category. In general category navigation tag has the following structure: #RE_CATTEGORY_NAVIGATION_TEMPLATE[_ID]# For the pre-defined templates of the English language: #RE_CATEGORY_NAVIGATION_default_1# - the page displays a path to a category with ID 1. #RE_CATEGORY_NAVIGATION_default# - the page displays a path to the current category. Templates that are used to display the NAVIGATION element for the English language are stored in the following folder: realestate-templates/en/category/navigation These templates consist of several files. The pre-defined template is stored in the following folder: realestate-templates/en/category/navigation/default Let's look at this template's files in more detail, including their local special tags. cat_path_begin – represents a title for a category path. This file has no local special tags. cat_path_end – represents a footer for a category path. This file has no local special tags. cat_path_part – represents a link to any category in the path. It contains the following special tags: #CAT_PATH_URL# - this tag is replaced with URL of the page displaying category content. #CAT_PATH_NAME# - this tag is replaced with the name of the category in the path. cat_path_separator – this tag separates categories in the path. You can modify the pre-defined template for this element, as well as create your own templates. To add a new template, create a new folder under the realestate-templates/en/category/navigation folder and create there 4 files described above. The names of the files must fully match the specified names. To use the new template, put the name of a new folder into the TEMPLATE part of global special tags . The LIST element represents a list of nested categories. This object offers the easiest way to walk through the categories. Initially it displays all categories located under the root category of your real estate site. When a visitor selects a category from the list, it displays the nested categories of the selected categories. See picture 39 for an example. =)
To display category navigation controls, enter LIST in the ELEMENT part of the special tag. In the TEMPLATE part of the tag you can enter the word default. This template is created automatically with a new language . This special tag also has one optional parameter - a set of colors for the background of every list row. If this parameter is not present, then the white color is used as a background color for all rows. If you want to specify several colors in this parameter, you can do this by separating colors with comas. Every color is represented by six hexadecimal numbers. You can use any graphical program to get a hexadecimal representation of a desired color, or you can alternatively see three decimal numbers from 0 to 255 representing the RGB values of the selected color. In the first case you can just copy the sequence of numbers to the LIST object parameter. The three RGB values must be previously converted into the hexadecimal numbering system using a calculator (for example, a standard Windows calculator), then compile these numbers into a sequence of numbers starting from the R component, then the G component and finally the B component. In general the tag of this element has the following structure: #RE_CATEGORY_LIST_TEMPALTE[_COLOR1,COLOR2,...,COLORn]# For the pre-defined templates of the English language: #RE_CATEGORY_LIST_default_EFEFEF,FFFFFF# - in this case the script will display gray and white colors one-by-one as a background. #RE_CATEGORY_LIST_default# - in this case the background of all rows will be white. The LIST-START-AT-ID element represents a list of categories. The only difference from the LIST element is that the LIST-START-AT-ID element has one mandatory parameter - ID . This parameter contains the ID of the initially displayed category. You can see the category ID in the first column of the list of categories in the Administrator control panel (see Section 4 - Manage categories ). In other respects this element is similar to the LIST element. In general the tag of this element has the following structure: #RE_CATEGORY_LIST-START-AT-ID_TEMPLATE_ID[_COLOR1,COLOR2,...,COLORn]# For the pre-defined templates of the English language: #RE_CATEGORY_LIST-START-AT-ID_default_1_EFEFEF,FFFFFF# - in this case the page first displays a category with ID 1. Background colors are gray and white used one-by-one. #RE_CATEGORY_LIST-START-AT-ID_default_1# - in this case the page first displays a category with ID 1. The background of all rows will be white. The LIST-ALWAYS-ID element also represents a list of categories. Like the LIST-START-AT-ID element, it has one mandatory parameter ID . But unlike the LIST-START-AT-ID element, this element always displays a category with the ID specified in this parameter, no matter what category has been selected from the list. This element can be used for menu. In general the tag of this element has the following structure: #RE_CATEGORY_LIST-ALWAYS-ID_TEMPLATE_ID[_COLOR1,COLOR2,...,COLORn]# For the pre-defined templates of the English language: #RE_CATEGORY_LIST-ALWAYS-ID_default_1_EFEFEF,FFFFFF# - in this case the script displays a category with ID 1. Background colors are gray and white used one-by-one. #RE_CATEGORY_LIST-ALWAYS-ID_default_1# - in this case the script always displays a category with ID 1. The background of all rows will be white. Templates used to display the LIST, LIST-START-AT-ID and LIST-ALWAYS-ID elements for the English language are stored in the following folder: realestate-templates/en/category/list These templates consist of several files. The pre-defined template is stored in the following folder: realestate-templates/en/category/list/default Let's look at this template's files in more detail, including its local special tags. cat_list This file represents a skin of the category list if a category has subcategories. In this case the rows of the list are inserted into this template instead of the local special tag #CAT_ROWS#. The local special tag #PARENT_CAT_NAME# allows you to insert the name of the currently viewed category. cat_list_empty This file is used when the selected category contains no subcategories. To display the name of the category, the local special tag #PARENT_CAT_NAME# is used. cat_list_one This file represents a single row of the category list. The list of subcategories is formed with the help of several instances of this template. The following local special tags are used in this template: #CAT_COLOR# is replaced with a row color of the appropriate subcategory. Colors are passed in the [_COLOR1,COLOR2,...,COLORn] parameter (see Section 11 - Global special tags ). #CAT_URL# is replaced with URL of the page displaying the appropriate subcategory. #CAT_NAME# is replaced with the name of the appropriate subcategory. cat_list_spacer This template is used to separate rows of the list, that is row templates are interleaved with this template. This file is placed at the beginning and at the end of the list. This file has no local special tags . You can modify the pre-defined template, as well as create your own templates. To add a new template, create a new folder under the realestate-templates/en/category/list folder and create there four files described above. The names of these files must fully match the names mentioned earlier. To use new templates, specify the name of the new folder in the TEMPLATE part of global special tags. The LIST-COLUMNED element represents a list of nested categories. Initially it displays all categories stored under the root category of your real estate site. When a visitor selects a category from the list, the script displays subcategories of the selected category. See picture 40 for an example . =)
To display category navigation controls, enter LIST-COLUMNED in the ELEMENT part of the special tag. The TEMPLATE part of the tag may contain the default name. This template is created automatically with a new language. This special tag also has one optional parameter - the number of columns for the list. If this parameter is not present, then one column of categories is displayed. In general the tag of this element has the following structure: #RE_CATEGORY_LIST-COLUMNED_TEMPLATE[_COLUMNS-NUMBER]# For the pre-defined templates of the English language: #RE_CATEGORY_LIST-COLUMNED_default_3# - in this case the script displays the list of categories in three columns. #RE_CATEGORY_LIST-COLUMNED_default# - in this case the script displays the list of categories in one column. The LIST-COLUMNED-START-AT-ID element is similar to the LIST-START-AT-ID element, with the exception that the script displays a multi-column list of categories. In general the tag of this element has the following structure: #RE_CATEGORY_LIST-COLUMNED-START-AT-ID_TEMPLATE_ID[_COLUMNS-NUMBER]# For the pre-defined templates of the English language: #RE_CATEGORY_LIST-COLUMNED-START-AT-ID_default_1_3# - in this case the content of the category with ID 1 is first displayed. The list of categories has 3 columns. #RE_CATEGORY_LIST-COLUMNED-START-AT-ID_default_1# - in this case the content of the category with ID 1 is first displayed. Categories are displayed in one column. The LIST-COLUMNED-ALWAYS-ID element is similar to the LIST-ALWAYS-ID element, with the exception that the script displays several columns of categories. In general the tag of this element has the following structure: #RE_CATEGORY_LIST-COLUMNED-ALWAYS-ID_TEMPLATE_ID[_COLUMNS-NUMBER]# For the pre-defined templates of the English language: #RE_CATEGORY_LIST-COLUMNED-ALWAYS-ID_default_1_3# - in this case the script will always display the content of the category with ID 1. The list of categories has 3 columns. #RE_CATEGORY_LIST-COLUMNED-ALWAYS-ID_default_1# - in this case the script will always display the content of the category with ID 1. Categories will be displayed in one column. Templates used to display the LIST-COLUMNED, LIST-COLUMNED-START-AT-ID and LIST-COLUMNED-ALWAYS-ID elements for the English language are stored in the following folder: realestate-templates/en/category/list-columned/ These templates consist of several files. The pre-defined template is located in the following folder: realestate-templates/en/category/list-columned/default Let's look at this template's files in more detail, including their local special tags. cat_begin This file represents a title of the list if the selected category has subcategories. You can insert the name of the current category using the local special tag #PARENT_CAT_NAME#. cat_row This file represents a row of the list of subcategories. The list consists of a sequence of rows. Columns with specific subcategories are inserted into this template instead of the local special tag #CAT_CELLS#. cat_cell This file represents one column with a subcategory in the selected category. A sequence of such columns replaces the local special tag #CAT_CELLS# in the cat_row template. The cat_cell template contains the following special tags: #CELL_WIDTH# is a column width on the page. This value is calculated automatically depending on the number of columns defined in the parameter of global special tags LIST-COLUMNED, LIST-COLUMNED-START-AT-ID or LIST-COLUMNED-ALWAYS-ID. #CAT_URL# is replaced with the URL of the page displaying the content of a subcategory. #CAT_NAME# is replaced with the name of the appropriate subcategory. cat_cell_empty This file is used as an empty column of the last row when the number of subcategories is not enough for all columns. For example, if you have 7 subcategories and the value of COLUMNS-NUMBER equals to 3, then this template is used for the last two columns of the third row. #CELL_WIDTH# is a column width on the page. This value is calculated automatically. cat_end This file represents a footer of the list of subcategories. This file does not contain any local special tags. cat_empty This file is used if the selected category has no subcategories. You can display the name of the category using the local special tag #PARENT_CAT_NAME#. You can modify the pre-defined template for the above-mentioned elements, as well as create your own templates. To add a new template, create a new folder under the realestate-templates/en/category/list-columned folder and create there 6 files described above. The names of the files must fully match the names mentioned earlier. To use new templates, you need to specify the name of the new folder in the TEMPLATE part of global special tags. The PROPERTY object This object controls the output of all property's information. It contains the following elements. The LIST element represents a list of properties in the current category. A current category is the category selected by a user from the list of categories, or a root category if a user has just logged in to the real estate site. Properties are displayed in one column. This element has a set of optional parameters. The first parameter is a list of colors that are displayed one by one as a background for rows of the list. If this parameter is not present, the white color is used for all rows. If you want to set several colors in this parameter, you can do this by separating colors with comas. Every color is represented by six hexadecimal numbers. You can use any graphical program to get a hexadecimal representation of a desired color, or you can alternatively see three decimal numbers from 0 to 255 representing the RGB values of the selected color. In the first case you can just copy the sequence of numbers to the LIST object parameter. The three RGB values must be previously converted into the hexadecimal numbering system using a calculator (for example, a standard Windows calculator), then compile these numbers into a sequence of numbers starting from the R component, then the G component and finally the B component . The second and the third parameters are used to sort properties. In this case the second parameter must contain the code of the field to sort by. You can see this code in the third column of the list of fields in the Administrator control panel. The third parameter must contain the type of sorting. It can have one of the following values: ASC or DESC. Depending on the value, properties are sorted in the ascending or descending order respectfully. If the type of sorting is not set, then ascending sorting is used by default. If the field is not present, properties are sorted by the date and time when they were added to your real estate site. In general the tag of this element has the following structure: #RE_PROPERTY_LIST_TEMPLATE[_COLOR1,COLOR2,...,COLORn_FLD-CODE_ASC/DESC]# For the pre-defined templates of the English language: #RE_PROPERTY_LIST_default_EFEFEF,FFFFFF_DATE_DESC# - in this case the script uses gray and white colors one by one as the background for rows of the list. Properties are also sorted by the field DATE in descending order. #RE_PROPERTY_LIST_default_EFEFEF,FFFFFF_DATE# - in this case the script uses gray and white colors one by one as the background for the rows of the list. Properties are sorted by the field DATE in ascending order. #RE_PROPERTY_LIST_default_EFEFEF,FFFFFF# - in this case the script uses gray and white colors one by one as the background for the rows of the list. Fields are sorted in ascending order . If the field is not present, properties are sorted by the date and time when they were added to your real estate site. #RE_PROPERTY_LIST_default# - in this case the background for all rows is white. Fields are sorted in ascending order . If the field is not present, properties are sorted by the date and time of their addition to your real estate site. The LIST-AT-ID element is similar to the LIST element, with the exception that it has one mandatory parameter: ID which represents the ID of the category whose properties are to be displayed in this place of the page. This element only displays properties of a category with the specified ID regardless of the current category. In general the tag of this element has the following structure: #RE_PROPERTY_LIST-AT-ID_TEMPLATE[_COLOR1,COLOR2,...,COLORn_FLD-CODE_ASC/DESC]# For the pre-defined templates of the English language: #RE_PROPERTY_LIST-AT-ID_default_1_EFEFEF,FFFFFF_DATE_DESC# - in this case the script will always display properties listed under the category with ID 1. The background colors of the rows are gray and white. Properties are sorted by the DATE field in descending order. #RE_PROPERTY_LIST-AT-ID_default_1_EFEFEF,FFFFFF_DATE# - in this case the script will always display properties listed under the category with ID 1. The background colors of the rows are gray and white. Properties are sorted by the DATE field in ascending order. #RE_PROPERTY_LIST-AT-ID_default_1_EFEFEF,FFFFFF# - in this case the script will always display properties listed under the category with ID 1. The background colors of the rows are gray and white. Fields are sorted in ascending order. If the field is not present, properties are sorted by the date and time of their addition to the real estate site. #RE_PROPERTY_LIST-AT-ID_default_1# - in this case the script will always display properties listed under the category with ID 1. The background color of all rows is white. Fields are sorted in ascending order. If the field is not present, properties are sorted by the date and time of their addition to the real estate site. The LIST-FEATURED element displays a certain number of featured properties in one column. This element has one mandatory parameter - the number of properties to be displayed. It also has one optional parameter - the list of colors to be used as the background colors for the rows of the list. In general the tag of this element has the following structure: #RE_PROPERTY_LIST-FEATURED_TEMPLATE_NUMBER[_COLOR1,COLOR2,...,COLORn]# For the pre-defined templates of the English language: #RE_PROPERTY_LIST-FEATURED_default_10_EFEFEF,FFFFFF# - in this case the script will display 10 featured properties. The background colors of the rows are gray and white. #RE_PROPERTY_LIST-FEATURED_default_10# - in this case the script will display 10 featured properties. The background color of all rows is white. The template used to display the LIST, LIST-AT-ID and LIST-FEATURED elements for the English language is stored in the following folder: realestate-templates/en/property/list These templates consist of several files. The pre-defined template is located in the following folder: realestate-templates/en/property/list/default Let's look at this template's files in more detail, including their local special tags. prop_list This file represents a skin of the list if a category has properties. For the list of featured properties it means that at least one property must be featured. In this case rows of the list are inserted into this template instead of the local special tag #PROP_ROWS#. prop_list_empty This file is used if the selected category has no properties. For the list of featured properties it means that there are no featured properties. prop_list_one This file represents one row of the list of properties. The list of properties is formed by interleaving this template with the prop_list_spacer template. The prop_list_spacer template is also added at the beginning and at the end of the list, and it doesn't contain any local special tags. The prop_list_one template uses the following local special tags: #PROP_COLOR# is replaced with the color of the row of the appropriate subcategory. Colors are passed in the [_COLOR1,COLOR2,...,COLORn] parameter (see Section 11 - Global special tags ). #PROP_URL# is replaced with the URL of the page displaying property detailed information. #PROP_LIST_IMG# is replaced with the URL of the list image for a particular property. This template can also contain any local special tags like #FIELD_..., #GROUP_..., #MULTIPLE_... You can modify the pre-defined template for these elements, as well as create your own templates. To add a new template, create a new folder under the realestate-templates/en/property/list folder and create the above-mentioned files there. The names of the files must fully match the names listed earlier. To use new templates, specify the name of the new folder in the TEMPLATE part of global special tags. The DETAILS element displays current property's detailed description. A current property is a property selected by the user in the list of properties. In general the tag of this element has the following structure: |