...Drupal!

From my boss:

The recently unveiled new site for Connect for Kids has garnered rave reviews from staffers and users. Thanks to the Drupal CMS for making this an easy-to-use and feature-rich web site.

Cecilia Garcia
Executive Director
Connect for Kids

As for me:

I Don’t know what I would have done without Drupal. I have been able to meet so many requests for specific functionality with a minimum amount of effort.

We were working with an archaic CMS that allowed us no customization and had little features. Now we have the world at our fingertips and only our imaginations to hold us back.*

I have created a few custom modules for the site that I plan on on sharing with the Drupal community. If I can just find the time…

Check out the Connect for Kids' Web site

Thanks,
-Jeremy Isett

*Also: Budget cuts, vacation time, inter-office politics, etc...

Comments

matt westgate’s picture

Being able to minimize/maximize sidebar blocks is pretty cool. How'd you do that?

epicflux’s picture

A function prints a form to each block that passes the block's id to a page that sets a session variable for the state of the block. Then the block reads the session variable and prints the content, or not.

I had to turn off the cache for this to work with anonymous users; which I didn't realize I would have to do when I was first creating this. If there is a way for this feature to work with the cache on then please let me know.

I originally thought the cache only cached the content of a node…boy was I naive…

Here's the module:


function minimize_block_menu() {
  $items = array();
  $items[] = array('path' => 'minimize_block',
    'callback' => 'minimize_block_page',
    'access' => user_access('access content'),
    'type' => MENU_CALLBACK);
  return $items;
}

function minimize_block_page() {
  global $base_url;
  $edit = $_POST['edit'];
  $rurl = $edit["rurl"] ? $edit["rurl"] : $base_url;
  $block = $edit["block_id"];
  
  //if the session has been set to 1 (minimized) then set it to 0, if not then set it to 1
  if($_SESSION['min_'.$block] == 1) {
    $_SESSION['min_'.$block] = 0;
  } else {
    $_SESSION['min_'.$block] = 1;
  }
  header('Location:'.$rurl);
}

//TODO: make the image change with the state of the block
function minimize_block_form_m($block_id) {
  $form_item = form_hidden('rurl',$_SERVER['REQUEST_URI']);
  $form_item .= form_hidden('block_id',$block_id);
  $form_item .= form_button('submit', 'submit', 'image', array('src' => '/image/main/icons/minmax.gif', 'title' => 'Minimize/Maximize (page reload required)'));
  return form($form_item,'post','/minimize_block',NULL);
}

and heres the block code


<div class="<?php print "block block-$block->module" ?>" id="<?php print "block-$block->module-$block->delta"; ?>">
  <div class="block-title">
  <?php if($block->region == 0) : ?>
    <div class="minimize-block">
      <?php print minimize_block_form_m('block-'.$block->module.'-'.$block->delta); ?>
    </div>
  <?php endif; ?>
   <div class="subject"><?php print $block->subject ?></div></div>
  <?php if($_SESSION['min_block-'.$block->module.'-'.$block->delta] == 1) : ?>
  <div class="content">This block is minimized</div>
  <?php else : ?>
  <div class="content"><?php print $block->content ?></div>
  <?php endif; ?>
</div>

mdroste’s picture

This is a great feature for sites with many blocks in the sidebar.
I try to use it on my site learn-php.de and will tell you if it works.

meinolf
learn-php.de

--
mdwp*

mdroste’s picture

This is a great feature for sites with many blocks in the sidebar.
I try to use it on my site learn-php.de and will tell you if it works.

meinolf
learn-php.de

--
mdwp*

sepeck’s picture

Could you go ahead and create a page for the handbook under the blocks item?

-sp
---------
Test site...always start with a test site.
Drupal Best Practices Guide

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

epicflux’s picture

I will do this. But before I make this really public (like I didn't already do that) I am going to add some features for administrators:

  • Permissions on who can minimize blocks, so you can run it without giving anonymous users access.
  • The ability to select which blocks can be minimized.

Anything else?

sepeck’s picture

Geez, I hadn't even thought of those items. That's pretty neat.

Good thing my sister-in-law doesn't read the support forums, she'd want the feature because of the neatness factor.

-sp
---------
Test site...always start with a test site.
Drupal Best Practices Guide

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide