Skip to content
This repository has been archived by the owner on Dec 28, 2020. It is now read-only.

Theme Hacks

Chris Carlevato edited this page Mar 27, 2017 · 1 revision

There are a variety of ways to implement customizations, however, the most upgrade-proof method is to add them directly to your theme. Custom Helios themes are “safe” when upgrading. By compartmentalizing your content changes (hacks) with your design changes (themes) it will allow for easier maintenance in the future and ensure that your custom files won't be affected by changes to core files that are modified when upgrading.

Documentation & Maintenance

To assist in the development of hacks Helios Calendar utilizes PHPDoc style internal documentation for functions to expose core content functionality for use within hacks.

Setting Variables

Named setting variable support can be enabled to facilitate easier use of settings within hacks. To enable named setting variables add (or uncomment) the following within your config.php file.

define("HC_Named", true);

When enabled a new cache file (/cache) will be available named settings_named.php containing descriptive naming of setting variables. This can be enabled temporarily for development purposes (documenting use of coded variables within hacks) or permanently (to use named variables directly within hacks).

Example

The following example shows how coded and named setting variables can be utilized within a custom hack function.

Coded Variables:

function output_tweet_hashtag_coded(){
    global $hc_cfg;

    echo $hc_cfg[59];
}

Named Variables:

function output_tweet_hashtag_named(){
    global $hc_cfg, $hc_cfg_named;

    echo $hc_cfg_named['tweet_hashtag'];
}
Clone this wiki locally