CaRP Evolution Documentation
CaRP Evolution Documentation
twitter youtube linkedin google-plus
CaRP Evolution Box
Web This Site

CaRP: Caching RSS Parser - Documentation


CaRP Interactive FAQ
Getting Started: Free Download | Purchase | Install
Reference: Functions | Plugins | Themes | Full Index
Etc.: Display Formatting | Example Code | Affiliates

Introduction to CaRP Themes

"Themes" is basically just a fancy way of saying "preset configurations". They make it easier to manage and share different configurations. If you look at the file "ul.php" in the themes folder, you will see that it contains a number of calls to CarpConf which configure CaRP to display a feed as an unordered list (thus the name "ul"). It also removes "image" from "iorder" (since images probably wouldn't look so good in an unordered list), limits the length of the description to 250 characters, and makes a few other changes that seemed appropriate. Putting all of these settings in a theme file makes it easy to reuse this configuration for various feeds around your site.

There are three ways to load themes. The most efficient is to add a line of code before the "require_once" line that loads CaRP, as follows:

$carptheme='ul';

or, if you're inside a function (basically, if the above doesn't work for any reason):

$GLOBALS['carptheme']='ul';

Either of those will tell CaRP to load the "ul" theme when it starts up. The name "ul" happens to match the name of the file, "ul.php", but it's possible that that won't always be the case--the important thing is that this value match one of the "case" statements in carpconf.php, for example, "ul" in the line in carpconf.php that begins with "case 'ul':".

If you've already loaded CaRP, you can load a theme like this:

CarpLoadTheme('ul.php');

Notice that in this case, you enter the filename, not the "case" value from carpconf.php. Note that this method will NOT reset CaRP's configuration to it's defaults, so if you've changed any settings for a different feed on the same page, those changes will still be there unless the theme overrides them. If you want to reset CaRP before applying the theme, do this instead:

MyCarpConfReset('ul');

Note that we're back to the "case" value from carpconf.php again, not the filename.

You can create new themes by modifing an existing theme file or create your own from scratch. Just be sure to upload it to the "themes" folder and to add a "case" line to carpconf.php like that one that's there for "ul".