chirale

IT and beyond

Display a custom cover embedding a youtube video and when stopped display the cover again using Youtube API.

Here an easy way to search and replace each occurrence a group of characters (in this case underscore and minus) with another (in this case a space) on a specified element (in this case each A), using Jquery javascript library. $(“a”).each(function() { $(this).html($(this).html().replace(/[_-]/g,” “)); }); The first argument passed on replace is a regex, if …

Continue reading

Tested on: Drupal 5.x Zen theme On your page.tpl.php, change default node links rendering with this: <?php if ($links): ?> <div class=”links”> <?php # add to favorites / bookmarks link $node->links[‘add2fav’] = Array( ‘title’=>trim(t(“Add to favorites”)), ‘href’=>$_GET[‘q’], ‘attributes’=>Array( ‘class’=>”add2fav”, ‘onclick’=>’bookmark()’, ) ); # intercept and theme node links print theme_links($node->links); print ‘<script type=”text/javascript”>// <![CDATA[ function …

Continue reading

Drupal modules needed: JQuery Update* JCarousel* (read JCarousel documentation) Contemplate Image Cache (optional, for thumb rendering) Lightbox v2 (optional, for thumb zoom to original image) * = tested on latest official release Howto subject: How to use JCarousel within a Contemplate modified node body JCarousel is a nice JQuery plugin to render a vertical or …

Continue reading