Drupal: How to show Drupal messages in a Nice Lightbox!!!
Submitted by programmer on Mon, 10/27/2008 - 14:37.
::
1. Install lightbox2 on drupal
2.
By placing the code below in your theme's page.tpl.php file, it's possible to have Drupal messages appear as modal popups. Just add the following code:
<pre>
<?php if ($show_messages && $messages): ?>
<div id="lightboxAutoModal" style="display: none;" ><?php print $messages; ?></div>
<?php endif; ?>
<div id="lightboxAutoModal" style="display: none;" ><?php print $messages; ?></div>
<?php endif; ?>
</pre>
You can control the size of the lightbox window, either via the configuration form at admin/settings/lightbox2/html_content - this is a global property which will affect the default size of all modal windows, or by adding a rel attribute like:
<pre>
<div id="lightboxAutoModal" rel="lightmodal[|height: 50px;]" style="display: none;" ><?php print $messages; ?></div>
</pre>
may not work in d6: http://drupal.org/node/783474
Post your Answer