function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

problem with global variable '$Site.Template'

The best way to create clear and user-friendly GUI for site is to use template page. Force .com platform provides such opportunity and we can create template and use it as a base page for other pages.

Also we can set default template name for our site and then we can refer to it by using global variable $Site.Template. But there is a big problem with it. Global variable $Site.Template has different values in developer and viewing modes.

So we have template page with name 'SiteTemplate' and page 'SiteLogin' which use this template. If I go to our site by entering the url address 'Default web address/SiteLogin' that template would be applied ($Site.template has value 'apex/SiteTemplate'). But in developer mode global variable $Site.template has other value ('site/SiteTemplate.apexp') and it`s the address of default template. As a result views for the same page are completely different and it`s very uncomfortale.

Are there any solutions for this problem?