The api documentation is a little lacking.

For example, for hook_skinr_elements it says:
* @todo Needs a better description.

Is it to define the possible element ID's for a given theme function?

Also, for hook_skinr_theme_hooks() it says:
* @param $element
* An element.

What is an element? I would assume an object of some sort, like a block or node or something, however it is concatenated like this:
'node_' . $element

So I would guess it an element ID, not an element.

They are the issues I have come across so far. I will try to make time to do a full api docs review from my perspective of a developer not familiar with the API.

Comments

rooby’s picture

Another thing that should be added is info about #1299162: Unable to get theme settings in skinr ui form

moonray’s picture

I could definitely use some help with docs.

Also, for hook_skinr_theme_hooks() it says:
* @param $element
* An element.

What is an element? I would assume an object of some sort, like a block or node or something, however it is concatenated like this:
'node_' . $element

An $element in this case (and throughout skinr module) is a string. An example using blocks is: system__powered_by (the resulting theme hook is block__system__powered_by). An example node content type element: article (the resulting theme hook is node__article).
These are similar (but lack the type definition) to what's used as theme hooks to create a template file name.

A note: $module is used throughout the skinr module, but can be confusing. See #1200352: $type and $module are used interchangeably in Skinr's code; fix this.

For example, for hook_skinr_elements it says:
* @todo Needs a better description.

Is it to define the possible element ID's for a given theme function?

hook_skinr_elements() is called by skinr_preprocess(). It returns "An array of $elements based on $module and $original_hook, derived from $variables." (from inline code description). An element is what links the applied skin to a block or a node or a view, etc (see above: hook_skinr_theme_hooks()). So for element = system__powered_by and module = block and theme = bartik a specific set of applied skins can be found.

I hope that makes sense. Hopefully you can put it into better words that we can apply to the docs.

moonray’s picture

Component: Code » Documentation
Issue summary: View changes