Template Documentation
From Open-Realty Wiki
The template system in Open-Realty 2 works by replacing {template tags} located in the template files with the real content that they represent. There are multiple template files required by Open-Realty all of which have unique template tags available.
The template system also interfaces with open-realty's login system to provide a set of permission tags for the different templates to allow you to restrict sections of your templates to different user groups. These permissions tags were updated in Open-Realty 2.1 so permission tags from a previous version may need to be updated.
Below will be a list of the different types of templates available in Open-Realty. Below each of the types of templates, in parenthesis you will see the path (location) of these template files so you will know where to find them if you wish to edit them or make your own. In the location TEMPLATE_NAME is the name of the template you are using per your configured template in the Site Configuration (Template Settings). In the path for the templates FILENAME is listed in place of the specific name of the template file that is used for that template.
Each type of template may have many different versions of that particular template file available. You will see them listed below each type of template along with a description of what they do. Most of the different template types can be selected in the configuration as to which one you want to use on your site while others only use a specific file and others will use different template files based upon the template tag you use to call the function that uses that template (for example the featured listings templates).
To make your own template from scratch, you will need to maintain the below file naming structure and at the minimum have at least one of the defined template files for each type of template. It may help to use the default "vertical-menu" template as a guidline.
ADMIN TEMPLATES
(/admin/template/TEMPLATE_NAME) These templates control the layout of the administrative area of your website where agents and admins login to edit listings, site configuration and perform other tasks. Template tags from the Main Admin Templates should work on any other administrative template page. Other template pages may also have their own set of template specific tags.
Main Admin Templates
(/admin/template/TEMPLATE_NAME/FILENAME) Tags: Template Tags - Permission Tags
1. main.html - This is the template for the main administrative section of the site. It is simply a html file with the tag {content} to specify where open-realty should place it's information.
2. or_index.html - This is the template used to generate the first page of the admin section that agents/admins see when they log in.
Edit Listings Template
(/admin/template/TEMPLATE_NAME/FILENAME) Tags: Template Tags - Permission Tags
This template is used to control the layout of the Edit Listings page which displays a list of the listings that can be edited.
1. edit_listings.html - This is the Edit Listings template. It has a number of tags available to it, see the edit_listings_template_tags page for details.
PUBLIC SITE TEMPLATES
(/template/TEMPLATE_NAME) These templates control the layout of the public portion of your website where visitors to your website will first come and then perform searches, view listings, read various information and contact you or your agents. Template tags from the Main Admin Templates should work on any other public template page. The other template pages may also have their own set of template specific tags.
Main Templates
(/admin/template/TEMPLATE_NAME/FILENAME) Tags: Template Tags - Permission Tags
Tags in these templates will also work when placed in the WYSIWYG page editor generated pages.
1. main.html - This is the template for the main site. It is equivalent to the user_top.html and user_bottom.html files for open-realty 1.x. It is simply a html file with the tag {content} to specify where open-realty should place its information. Information is made up of either sub template like the listing_detail_default.html file or direct content from OR.
2. popup.html - This is the template used on popup windows such as the Calculators and Agent Contact Forms. The template contains head/body/html tags but is otherwise a blank template. Use this template by setting &popup in the URL.
3. blank.html - This is a completely blank and empty template file used for popup windows by setting &popup=blank
4. printer_friendly.html - This is the template used when the user selects the Printer Friendly Page from listing details.
Optional
5. page#_main.html - This is an optional main template for the site that is based on the page number. If you wish to have a unique template design for a specific page such as having featured listings in a section of the template on the home page (Page 1) but not the rest of the site then you can create a page#_main.html template with the differences you want. Open-Realty will use the page#_main.html template for pages where the alternate main template exists, if there is no specific main template for that page then it will default to the main.html template for that page. (# would be the page number you want to use this main template for)
You can specify a PageID=# variable in the URL for any page on your site in order to specify an alternate main template file for the page you are displaying. The PageID=# variable is specified automatically for all page editor created pages, you can create a custom PageID for any other page you wish to have an alternate main template layout for.
6. searchresults_main.html - This is an optional main template that allows you to load a unique template for your search results page. This can be used to define custom metatags for your search result pages or to simply give your search results a different look from the main template.
7. 500.shtml - This is not a template that is used inside Open-Realty. This template is a 500 Internal Server error page that will be displayed to the user if there is a database error instead of displaying the SQL error on the page. This is for security and aesthetic purposes.
Listing Detail Templates
(/template/TEMPLATE_NAME/FILENAME) Tags: Template Tags - Permission Tags
These Templates are used when the user selects to view a listing. Which Template is used is determined by the administrator from the configuration screen. Any template named listing_detail_templatename.html will be shown as an option in the site configuration.
1. listing_detail_default.html - This is the default listing View template. It has a number of tags available to it, see the listing_template_tags page for details.
2. listing_detail_mainjavacolumn.html - This is the Listing View with Java Image with thumbnails in columns.
3. listing_detail_slideshow.html - This is the Listing View with Slideshow.
4. listing_detail_mainjavarows.html - This is the Listing View with Java Image with thumbnails in rows.
5. listing_detail_tabbed.html - This is the Listing View template with all the elements layed out using Tabs. (New in 2.3.2)
Optional
4. listing_detail_pclass#.html - This is an optional listing detail template based on the property class where the # is the property class ID. If you create a listing detail template with this naming for a specific property class then it will be used for listings in that property class, overriding your listing detail setting in the site config. When a template doesn't exist for a specific property class the setting in the site config will be used.
Search Page Templates
(/template/TEMPLATE_NAME/FILENAME) Tags: Template Tags - Permission Tags
This template is used to control the layout of the search page.
Most of this template is created dynamically by the software base upon which fields you have specified as searchable. Due to this there is only one search page template and is NOT selectable in the configuration.
1. search_page_default.html - This is the default search result template. It has a number of tags available to it, see the search_page_template_tags page for details.
Optional
2. search_page_class_CLASSID.html - IF there is a template file with this naming convention where the CLASSID is the number of the property class being searched then this search page template will be used instead of the default search page. (2.3.5 and later)
Search Result Templates
(/template/TEMPLATE_NAME/FILENAME) Tags: Template Tags - Permission Tags
This template is used to control the layout of the search result page, this is the most complex template file, as the search results are dependent the listing field setup and can be changed at any time.
Which Template is used is determined by the administrator from the configuration screen. Any template named search_result_templatename.html will be shown as an option in the site configuration.
1. search_result_default.html - This is the default search result template. It has a number of tags available to it, see the search_result_template_tags page for details.
2. search_result_box.html - This is a tabled layout for the search results containing more fields and information in a nicely formatted table.
3. search_result_nophoto.html - This is a simple single line of listing information without any thumbnail photo displayed.
4. search_result_tabbed.html - This is a basic implementation of the tabbed javascript code into a search results template to show the basic design and requirements of using the tabbed code on the search results.
Optional
5. search_results_class_CLASSID.html - IF there is a template file with this naming convention where the CLASSID is the number of the property class being searched then this search results template will be used, overriding your configuration's selected search results template.
Featured Listings Templates
(/template/TEMPLATE_NAME/FILENAME) Tags: Template Tags - Permission Tags
This template is used to control the layout of the featured listings.
Which Template is used is determined by the featured listing template tag used on your site. The Featured Listings template tag is: {featured_listings_NAME} where NAME is the name of the featured listings template included in your template directory. For example using the included templates: Using {featured_listings_vertical} will use featured_listing_vertical.html while using {featured_listings_horizontal} will use featured_listing_horizontal.html.
1. featured_listing_vertical.html - This is the vertical featured listings template. It has a number of tags available to it, see the featured_listings_template_tags page for details.
2. featured_listing_horizontal.html - This is the horizontal featured listings template. It has a number of tags available to it, see the featured_listings_template_tags page for details.
Search Property Class
(/template/TEMPLATE_NAME/FILENAME) Tags: Template Tags - Permission Tags
This template is used to control the layout of the Search Page Property Class selection.
1. search_class_default.html - This is the search property class template. It has a number of tags available to it, see the search_class_template_tags page for details.
View Users
(/template/TEMPLATE_NAME/FILENAME) Tags: Template Tags - Permission Tags
This template is used to control the layout of the View Users page which displays a list of the agents.
1. view_users_default.html - This is the view users template. It has a number of tags available to it, see the view_users_template_tags page for details.
View Agent
(/template/TEMPLATE_NAME/FILENAME) Tags: Template Tags - Permission Tags
This template is used to control the layout of the Agent Details page.
1. view_user_default.html - This is the view agent template. It has a number of tags available to it, see the view_user_template_tags page for details.
VTour Templates
(/template/TEMPLATE_NAME/FILENAME) Tags: VTour Template Tags - Permission Tags
This template is used to control the layout of the popup virtual tour page. This template is rather complex due to large javascript requirements in the <head> and other various details.
Which Template is used is determined by the administrator from the configuration screen. Any template named vtour_templatename.html will be shown as an option in the site configuration.
1. vtour_default.html - This is the default VTour template. It has a number of tags available to it, see the VTour Template Tags page for details.
2. vtour_classic.html - This is the "Classic" VTour template. The layout was designed after the original VTour code used in Open-Realty 2.x versions prior to templating being available. It has a number of tags available to it, see the VTour Template Tags page for details.
File Download Templates
(/template/TEMPLATE_NAME/FILENAME) Tags: Template Tags - Permission Tags
This template is used to control the layout of the file download section when using the vertical or horizontal templated file list.
Which Template is used is determined by the templated file download template tag used on your site. The templated file download template tags are:
For Listing Template:
{files_listing_NAME} where NAME is the name of the featured listings template included in your template directory. For example using the included templates:
Using {files_listing_vertical} will use files_listing_vertical.html while using {files_listing_horizontal} will use files_listing_horizontal.html.
1. files_listing_vertical.html - This is the vertical listing files template. It has a number of tags available to it, see the file_download_template_tags page for details.
2. files_listing_horizontal.html - This is the horizontal listing files template. It has a number of tags available to it, see the file_download_template_tags page for details.
For Agent Template:
{files_user_NAME} where NAME is the name of the featured users template included in your template directory. For example using the included templates: Using {files_user_vertical} will use files_user_vertical.html while using {files_user_horizontal} will use files_user_horizontal.html.
1. files_user_vertical.html - This is the vertical listing files template. It has a number of tags available to it, see the file_download_template_tags page for details.
2. files_user_horizontal.html - This is the horizontal listing files template. It has a number of tags available to it, see the file_download_template_tags page for details.
RSS Template
(/template/TEMPLATE_NAME/FILENAME) Tags: RSS Template Tags
This template is used to control the layout of the XML Data feed for the RSS Newsfeeds. This template is rather complex due to having to follow certain XML structure for proper XML output that can be read by RSS Newreaders. There are also several configuration options on the RSS tab of your site configuration that will effect the output of these newsfeeds.
In order to setup links to your RSS Newsfeeds you will need to add a link to one of the following actions:
rss_featured_listings - This will provide the user with an RSS Newsfeed of the featured listings. A link to this Newsfeed would look something like this: <a href="/index.php?action=rss_featured_listings" >{lang_rss_featured_link_title}</a>
rss_lastmodified_listings - This will provide the user with an RSS Newsfeed of the latest modified listings. A link to this Newsfeed would look something like this: <a href="/index.php?action=rss_lastmodified_listings" >{lang_rss_lastmodified_link_title}</a>
This template is not a configuration selectable template, your RSS Newsfeeds will always use this specific template file in your selected template directory.
1. rss.html - This is the RSS template. It has a number of tags available to it, see the RSS Template Tags page for details.
Next/Prev Template
(/template/TEMPLATE_NAME/FILENAME) Tags: Template Tags - Permission Tags
This template is used to control the layout of the Next/Prev section of search results and Listing Details page.
1. next_prev.html - This template is a single template file and the name is not configurable, the site will always use the next_prev.html file for this template.. It has a number of tags available to it, see the nex_prev_template_tags page for details.
Tab Pane Code Documentation
The Tab Pane code used in the Site Configuration is also available for use in the templates. Documentation on how to use the tabbed template code to create your own content tabs inside your templates.
Tabbed Content Code Documentation - Here is all the documentation for creating your own tabbed content areas within templates.
