Fork me on GitHub

List of Bricks

Bricks are extension modules for zena. There is a list of standard bricks that come included with zena. The file config/bricks.yml is used for basic brick enabling and settings.

single (-site)

If hosting only a single website, you can use the “single” brick to let zena keep the full-page cache in the standard “public/” folder. (Only needed if you have a non-customizable passenger setup, or the webserver won’t follow symlinks.)

fs_skin

Provides support to load skins (template, css, image, and javascript files) from bricks. Allows you to manage skins in synchonizable (brick) directory trees on the filesystem, instead of in the database.

Example: Converting an existing skin into a brick that contains skins:
  1. Enable the “fs_skin” brick
  2. Export a skin (turn dev mode “on”, go to the skin’s page, in the dev
    box there is an “export” link)
  3. Save the skin in the “bricks” directory with the following content. Here is an example brick with two skins, “foo” and “bar”:
    $RAILS_ROOT/bricks/myskins
      + zena
          + skins
              + foo
              + bar
                  - Node.zafu  (master template)*
                  - Page.zafu  (master template)*
                  - _ding.zafu  (partial)
                  - dict.en.yml (translations)
                  + static
                      - bar.css
                      - logo.png
    

    The static/ directory is for the assets. In this example, the files will be available under the url path /static/myskins-bar/.
  4. Adapt all your templates to include from to each other properly like this:
    Relative path: <r:include template='Node'/> or <r:include template='Classdir/_partial.zafu'/>
    Absolute paths need to include the skin name: 
       <r:include template='/skin_name/Node'/>
    
    Absolute paths to filesystem skins start with a "$" and a name like this:
       <r:include template='$brick_name-skin_name/Node'/>
       (e.g. '$myskins-foo/Node')
    
  5. Adapt the skin references to assets to correctly point into the brick. For example:
    fs_skin assets: <link href="/static/myskins-bar/bar.css" rel="Stylesheet" type="text/css"/>  
    
  6. Turn your brick “ON” in config/bricks.yml
  7. Create a skin node, go to the ”++” tab in its edit popup and set the z_static field to “myskins-bar”. (Do this for each skin in the brick. In the example, foo and bar.)
  8. Run rake fs_skin:index in order for zena to link the “master templates” in the filesystem skins to the corresponding virtual
    classes. It also updates the “public/static” folders of all sites, that contain symlinks to the folders inside the bricks: (public/static/myskins-bar -> bricks/myskins/zena/skins/bar/static)
  9. Assign your filesystem skin to nodes or sites as desired.
  10. After modifying a skin, you have to request the page it renders with ?rebuild=true, to trigger zafu cache rebuilding for the templates used to render the requested page. (The dev-mode overlay provides a button for this.) You may also use $ rake zena:clear_zafu to clear the entire template cache.

worker

Implements delayed jobs in zena.
(requires???: gem install delayed_job—version=1.8.4)

Usage example: free-text searching

free-text searching