In order to get content created with The Secretary onto your website, there are three preliminary steps to complete. The concept is that you create the page layout and design, and simply drop The Secretary in wherever you want content to be displayed. This gives you total creative freedom with your designs and separates the system from the website, and the content from the design.
The HQ Link establishes a connection with The Secretary so that content can be pulled into your page. Place the following at the very top of your HTML, before anything else. Replace ”/your/absolute/path” with the absolute path to the folder you installed The Secretary to. If you do not know what it is, login to your copy of the system and navigate to Home > About, where you can find a field under System Information labelled “Absolute Path”. Copy and paste that into the value of the $HQ variable (make sure it is within the quotes) and remove any trailing slashes (any '/' at the end).
<?php $HQ= "/your/absolute/path"; include_once "$HQ/secretary_loader.php"; ?>
The second step tells The Secretary which module(s) to load content from. This is done so that your pages do not become overloaded with content that is not being used or displayed. A separate call to secretary_load() must be written for each module to be loaded. If, for example, you wanted to show an image gallery you would need to load the Gallery module. To do so, you would place the following line after the two lines of the HQ Link…
secretary_load( "gallery" );
…so that it looks like this:
<?php $HQ= "/your/absolute/path"; include_once "$HQ/secretary_loader.php"; secretary_load( "gallery" ); ?>
This function is what actually places your content on the page. There is no limit to how many times it can be called on a single page, meaning you can display several different categories and templates (ie. different bits of content) from any given module.
Take a look at the templates tutorial for details on creating templates.
The function takes two parameters. The first is the module name (in lowercase). The second is a comma-separated list of settings to control things like which template to use, which category (or categories) to display, and various other options a module may have. The settings parameter is optional, meaning that if it is omitted, then the defaults will be used instead. Here is an example of how to use the function with the Gallery module:
<?php $settings= "template= CoolTemplate, category= list, of, categories"; bam( "gallery", $settings ); ?>
Now that we have covered the three essential steps to incorporate The Secretary into your webpage, here is a basic page template to help clear any confusion.
<?php // The all important HQ Link $HQ= "/your/absolute/path"; include_once "$HQ/secretary_loader.php"; // Load in the Gallery module secretary_load( "gallery" ); ?> <html> <head> <title>My Portfolio</title> </head> <body> Some text. <!-- Here is where my content should load --> <?php $settings= "template= CoolTemplate, category= Personal Projects"; bam( "gallery", $settings ); ?> </body> </html>