General
Getting Support
Administration
Design
Wolf Reference
Plugin Development
Core Development
- Design documents
- Working guidelines
- References
Press, Graphics and Translations
Wolf CMS books section
Constants
Wolf uses some “constants” which can be useful for site development:1)
URL_PUBLIC
URL_PUBLIC returns the homepage URL of the Wolf website in the format http://www.mywolfsite.com/ (with trailing slash). It is used throughout the default Layouts to provide a dynamic reference to the website. For example, the favicon is called in the Simple layout with this code:
<link rel="favourites icon" href="<?php echo URL_PUBLIC; ?>favicon.ico" />
URI_PUBLIC
URI_PUBLIC returns the home location of the Wolf website. This makes it possible to pass a reference relative to the location of Wolf's index page. If Wolf's index.php lives in the root directory (e.g., http://www.mywolfsite.com/), then echo URI_PUBLIC will simply return /. If it lives in a subdirectory (e.g. http://www.example.com/wolfcms/), then echo URI_PUBLIC will return the root directory like this: /wolfcms/
BASE_URL
BASE_URL is closely related to URL_PUBLIC, and when USE_MOD_REWRITE is set to “true” in config.php, they are identical. However, when USE_MOD_REWRITE is set to “false”, BASE_URL will include the ? in the URI.
In the default sidebar to the Home Page, the RSS feed link is given this way:
<a href="<?php echo BASE_URL; ?>rss.xml">Articles RSS Feed</a>
CURRENT_URI
Echoing CURRENT_URI will return the part of the current URL following the URI_PUBLIC (see above), ignoring any page suffixes. Examples:
| Full URL | URI_PUBLIC | CURRENT_URI |
|---|---|---|
| http://www.mywolfsite.com/about_us | / | about_us |
| http://www.example.com/wolf/about_us | /wolf/ | about_us |
| http://www.example.com/wolf/about_us.html | /wolf/ | about_us |
| http://www.example.com/grocers-site/fruit/oranges.html | /grocers-site/ | fruit/oranges |
| http://www.mywolfsite.com/articles/2009/07/24/my_second_article | / | articles/2009/07/24/my_second_article |
CMS_ROOT
The CMS_ROOT contstant returns the file path of the server to the directory where Wolf is installed. If you installed Wolf to the htdocs root directory of your site, this code:
<?php echo CMS_ROOT; ?>
would return a value something like:
/home/vol8/mywolfsite.com/my_account_name/htdocs
