ThesisAPISkinMethods → boxes()

boxes() — Thesis Skin API Method

Core Thesis Boxes cover basic website functionality, but some Skins may require custom Box functionality to achieve certain outcomes. In this case, the developer must do the following:

  1. create a custom Box (or Boxes) using the Thesis Box API
  2. place all custom Boxes in a separate Skin file named box.php
  3. include custom Boxes via the boxes() Skin API method

Here’s the general syntax for the boxes() method, which expects you to return an array of custom Box class names:

protected function boxes() {
	return array();

Assuming a Skin that has two custom Boxes, my_cool_box and my_sample_box, here’s what your boxes() method would look like:

protected function boxes() {
	return array(

If you’ve set up your boxes() method properly, your Boxes will either “just work” or appear as available Boxes within the Skin Editor, depending on the particular Box types. There is one special case you should be aware of, though.

If your Skin needs to register a Box that should only appear as a dependent of another Box and never deployed on its own, then you should leave that Box class out of the boxes() method shown above.

Finally, if your Skin only has one Box—and that Box is a dependent Box—then simply include an empty boxes() method in your Skin (this ensures the box.php file will be included).