Skip to content
This repository was archived by the owner on Mar 3, 2025. It is now read-only.

How to create an OS box

baisong edited this page Sep 19, 2012 · 4 revisions

Boxes are a way to store block content as a site configuration, not as content. There are many advantages to using boxes, and their easy to implement yourself! The os_boxes module integrates boxes with OpenScholar, allowing each site to configure blocks individually as a part of spaces features.

You will need:

  • A local testing environment
  • A github account to contribute code

Directions

  1. Contribute a new class definition in /openscholar/modules/os/modules/os_boxes/plugins. To do so, first choose a new machine-readable name, then make a directory by that name, with a .inc file in that directory (see the plugins folder for these conventions).

    The .inc file should look something like this:
    ``` class os_boxes_mybox extends os_boxes_default { ... }

2) Include the new class in [os_boxes.plugins.inc](https://github.com/openscholar/openscholar/blob/SCHOLAR-3-0/modules/os/modules/os_boxes/os_boxes.plugins.inc)

3) On your local environment, enable and disable a module to allow your site to detect the new plugin. You will see it appear at /admin/structure as a new box type.

Clone this wiki locally