Defining a Mosaik layout

Mosaik Layouts definition is as simple as hook_theme implementation.
To define a layout we have to implement hook_mosaik_layout($path).
See example below:

Creating a Piece via code

To define a piece you have to implement hook_mosaik_piece() (the following code is taken directly from piece module):

Extending / altering default piece callback types

If your are a developer and you want to add or alter the default piece callback types, you can do it implementing hook_pieces_callbacks_alter(&$callbacks) as you can see from the pieces_callbacks() function:

Creating a Mosaik via code

You can generate your Mosaiks also implementing hook_mosaik() from your module:

Exporting configuration

Important: This page is a tour of the code for the submodule patterns_export and the components. If you are looking for information on how to write a an export function for a component please read this section before.

Exporting patterns: Flow of Execution

In this section we will analyze the flow of execution provided by the submodule patterns_export, that allows us to extract Patterns files automatically. For this example we will be using the color component.

  • A new entry in the menu is set by hook_menu_alter(). The function called when accessing to the url is patterns_export(), which will check if there are any parsers available and call the function patterns_export_page1() after loading all the components.
  • The function patterns_export_page1() will take care of:
    • Invoke all the modules implementing patterns, and filter those which provide any export function.
    • Prepare the form with the granularity options to export for each of these components (i.e.: the taxonomy component allows to export terms and/or vocabularies).

Patterns 7.x for contributors: A tour of the code

The purpose of this document is offering a starting point for contributors and developers to understand patterns code. The tour's aim is to provide an outer to inner overview, in a similar way we do while debugging the code.

Pages

Subscribe with RSS Subscribe to RSS - code