The Portal Object encapsulates all the BEE portal functions into one piece. It is to be created at the begining of the web page before any BEE features are used. It is typically right after "<head>", so that you can start using the portal object's features from the "<title>" onwards. This is common to both Page Menu and Action Menu models.
<html> <head> <script language="bee"> include "portal/portal.bs"; pt = new portal; PortalObjectName = pt; // Useful constants SiteURL = "{pt%SiteURL|pt%convPath:,/}"; // Utility actions switch ('{sys%urlpart:pathpage}') { case '{pt%Subpath}/menuedit.htm': include "portal/menuedit.bs"; break; case '{pt%Subpath}/organizer.htm': include "portal/organizer.bs"; break; } </script> <title>${pt%SiteName}</title> ...
Note 1: While the portal object "pt" is an arbitrary name, the variable name "PortalObjectName" is fixed and must be set to the name of the portal object ("pt"). Other system utilities use the PortalObjectName to find the portal object.
Note 2: The {SiteURL} variable is derived from {pt%SiteURL} by appending a "/" at the end unless there is a "/" already. |