CVS edit link for florian.cathala

Hello,

I have been using Drupal as a developer, theme integrator and webmaster for more than 3 years at Ambika (french company, member of the Drupal Association since 2008), where I drove several little and wider projects as a project manager / CTO.

I have developed a module called "Per-Theme Blocks" that allows themes to override blocks information through a THEME_blocks_info() function in template.php.
This is especially helpful to manage several sites with several themes that need different blocks information (region, weight, status...).

You can download the current release at the following address :
http://bureau.ambika.fr/per_theme_blocks.tar.gz

Best regards,

--
Florian Cathala
fc@ambika.fr

Comments

florian.cathala’s picture

StatusFileSize
new3.69 KB

You will find here as attached file the current release of the "Per-Theme Blocks" module.

florian.cathala’s picture

Status: Postponed (maintainer needs more info) » Needs review
avpaderno’s picture

Status: Needs review » Needs work

Thanks for applying for a CVS account.
As per Apply for contributions CVS access, the motivation needs to be expanded, and include more features of the module.

florian.cathala’s picture

Thank you for your answer, kiamlaluno.

I have created this module because I need a feature that I did not find in any existing module.

This module allows theme developers to provide blocks information (position, visibility...) through a THEME_blocks_info() function in the template.php file of the themes.
This (optional) function must return an associative array that return the blocks definition that should override the existing one. The syntax is the same as the hook_blocks() one for 'list' op. For example :

function mytheme_blocks_info() {
  return array (
    'menu_primary-links' => array ( 'weight' => '1', 'region' => 'header', ),
    'myblock1' => array ( 'weight' => '2', 'region' => 'right', ),
    'myblock2' => array ( 'weight' => '1', 'region' => 'footer', ),
    'block_to_hide' => array ( 'status' => '0', ),
  );
}

Thus, thanks to the blocks admin page, the site administrator can override the existing blocks information with information provided by the theme by checking a "Reset blocks" box before clicking "Save blocks".

Features :
* allows per-theme blocks definition through THEME_blocks_info() function
* allows site administrator to override blocks informations (position, visibility...) as suggested by the theme
* export existing blocks information to ease the creation of the THEME_blocks_info() function

Of course all code is released under the GPL v2 license.

I hope this helps and my CVS account is approved soon.

florian.cathala’s picture

StatusFileSize
new3.68 KB

After a new self review, I removed a debug-related "print_r()" function.

Here is the refreshed tarball.

florian.cathala’s picture

Status: Needs work » Needs review
avpaderno’s picture

Issue tags: +Module review

I am adding the review tags.

avpaderno’s picture

Status: Needs review » Fixed

Thank you for your contribution! I am going to update your account.
These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank all the dedicated reviewers as well.

Status: Fixed » Closed (fixed)
Issue tags: -Module review

Automatically closed -- issue fixed for 2 weeks with no activity.

avpaderno’s picture

Component: Miscellaneous » new project application
Assigned: Unassigned » avpaderno
Issue summary: View changes