jide's blog

Sometimes we need to add template suggestions to a module. To do this, we need to alter the registry and add the template suggestion to the preprocess function.

To add a template suggestion for blocks named "mytemplate.tpl.php" in the "theme" subfolder of your module, do the following :

/**
* Implementation of hook_theme_registry_alter().
*/
function MYMODULE_theme_registry_alter(&$theme_registry) {
  $theme_registry['block']['theme paths'][] = drupal_get_path('module', 'MYMODULE') . '/theme';
}
 
/**
* Implementation of hook_preprocess_block().
*/
function MYMODULE_preprocess_block(&$variables) {
  $variables['template_files'][] = 'mytemplate';
}

To extend a jQuery UI widget with your own widget, 3 important things :

  • jQuery UI uses the data() function to store information related to the widget. The data identifier of the element will be your widget name, so you must copy its value to the original data value.
  • For each function you want to extend, call the original function of the widget with apply().
  • Set the default options.

$.widget("ui.customsortable", $.extend({}, $.ui.sortable.prototype, {
 
  _init: function(){
    this.element.data('sortable', this.element.data('customsortable'));
    return $.ui.sortable.prototype._init.apply(this, arguments);
  }
 
  // Override other methods here.
 
}));
 
$.ui.customsortable.defaults = $.extend({}, $.ui.sortable.defaults);

Freshy 2 theme and Customize plugin have been updated for Wordpress 2.9. I just followed instructions at http://ocean90.wphelper.de/en/3127/fix-freshy-theme-wordpress and did not test this out. Please tell me if everything is fine.

Since I do not have time for Freshy 2 and Customize development, I will put source code on GitHub to allow other developers to help maintain code for future releases.

Finally !
It is more than 2 years now that i am involved with Drupal and my Wordpress site was dying. After creating Likwid, a web agency specialized in Drupal, I could not find time to make a new version of my site.
Since the site literally exploded, i had to rush and quickly finish the work I started... over a year ago.
Wordpress fans may be a little disappointed since I probably won't do any Wordpress related work anymore. But when I'll have some more time, I'll release the site theme to the Drupal community.
That's a new start and I will post again on this site.
See you soon !

Here it is ! The 2.7 compatible version of Freshy (version 2.1) is out ! Grab it while it is hot ! Freshy 2.1

A new release for customize has also been released, update it too :
Customize 1.0.4

Enjoy !

This site has been really quiet recently. I have been busy with my work and did not have time for Freshy. But I have some news for you !

Freshy 2.1 is almost ready, it will be compatible with wordpress 2.7, numerous bugs have been corrected et some features have been dropped since it was becoming hard to maintain. I know some of you have been waiting a long time for such news, thanks for having been so patient.

My site will be totally redesigned. I will swicth to Drupal, with a whole new theme that will be released on this site too. I am focusing on Drupal now, and will release themes and modules. This is also the occasion to post again.

Stay tuned !

With my partners, we have created Likwid, a web agency specialized in Drupal, a very powerful and modular CMS. Stay Tuned !

Freshy theme and Customize plugijns have been updated. Grab them here.

I have corrected the theme and the plugin to be compatible with Wordpress 2.6. Go to the download page to download the updated version.

I will fix other issues later, but this one seemed urgent ;)

Enjoy !

After a long and quiet time on this site, a long period with a half working preview release, here it is : the final version of the Freshy 2 theme !

Syndicate content