The Sitemason® Development Library (PHP) is the layer of code that organizes the data residing in Sitemason, then presents that data to the template layer (the website) as a group of objects.
Accessing the Development Library
When you create a new Sitemason account and/or define a hostname for a new website, the most up-to-date version of the Development Library is included as part of the setup process.
The Development Library is loaded prior to calling your template file and includes three key pre-defined variables that you will, under almost every circumstance, make use of to develop your Sitemason template. These three variables are based on the data that is currently being viewed by the website visitor:
- $smCurrentSite: This is the SMFolder object representing the entire website. You'll use this object to access site-level data such as navigation data, copyright and other footer information, and Google Analytics details.
- $smCurrentFolder: This is the SMFolder object representing the folder containing the page that is currently being viewed in the browser. If your website is not hierarchical (if there are no subfolders and all tools are organized on one level), then $smCurrentFolder is identical to $smCurrentSite (because there is only one Folder in your website, therefore that Folder is the site).
- $smCurrentTool: This is the SMTool object representing the page that is currently being viewed in the browser.
Folders, Tools, Items, and Pages are the cornerstones of Sitemason's data organization scheme. For more information on these four concepts and how they interact with each other, please see the page on Sitemason's Data Structures.