Maintaining the special features
Maintaining the special features The listing of sites uses two conditional regions, an editable region and a repeating region, as you can see in this code (indentation added for clarification): |
<!-- TemplateBeginIf cond="!HasSites" --> |
The first conditional region displays a link to the My Connections dialog box if no connections have been created yet through an API call. The second conditional region appears if any connections have been created. Both conditional regions depend on a template parameter found in the <head> of the document called HasSites. Be sure to preserve this code when modifying the page: |
|
Both the repeating and editable regions are contained within the second conditional region. Be careful not to alter the names of these regions: Site and SiteName, respectively. Modifying the names breaks the functionality. The other unique feature on this page, the “Don’t show this page on startup” option, uses an internal cookie. When the user clicks the option, the cookie (dontshow) is set to either true or false. If the cookie is true, the Welcome page is bypassed and the initially declared connection is shown. The naming of the checkbox (dontShowCheckbox), as well as its onClick function call, is critical to keep if you want to maintain this option. Should you not want to give your users the option of seeing the Welcome page, you’ll need to do more than just remove the form element containing the checkbox and all of its contents. If you look at the <body> tag, notice the onLoad event that calls initControls(). The initControls() function populates the checkbox in the Welcome page if the dontshow cookie is set. How do users show the Welcome page once they’ve opted not to see it? The page is displayed whenever they choose Help > Welcome. If you want to remove the “don’t show” option, be sure to also remove the onLoad event from the <body> tag and the initControls() function from the <head>. |
Comments