I have made a Zen sub-theme. It is working well except that the blocks admin page of the sub-theme does not contain drag handles. Without them I cannot arrange blocks within a region. When I switch to the Zen theme, the handles are there.

A previous post, http://drupal.org/node/486688 mentioned that the page.tlp.php needed $scripts in the head section and $closure at the bottom. My page.tpl.php file contains both those items.

Code snippits from my page.tpl.php:

<head>
  <title><?php print $head_title; ?></title>
  <?php print $head; ?>
  <?php print $styles; ?>
  <?php print $scripts; ?>
</head>
<?php print $closure; ?>
</body>
</html>

Another post, http://drupal.org/node/437826 suggested replacing the tabledrag.js file. I did this, but it did not fix the problem.

I have found other posts stating the same problem, but no help was given. Since the problem occurs when my sub-theme is the active theme and does not occur when Zen or Garland is the active theme, I believe that this is a theming problem.

When I view page source, here's what the Zen theme generates:

<td class="block">
   <a class="tabledrag-handle" href="#" title ="Drag to re-order">
      <div class="handle">&nbsp;</div>
   </a>
   Main Links
</td>

Here is what page source shows when the sub-theme is selected:

<td class="block">Main Links</td>

The ability to reorder blocks is essential. Any insights?

Comments

internetman’s picture

For me, I had to disable my own jQuery include as it was colliding with the jQuery lib that Drupal loads when needed (ie: drag table).

Hopefully this steers you in the right direction.

For my example, I added a check to see if jQuery was already loaded:

if(typeof $ == 'undefined') {
document.write("<script src='path/to/my/jquery.js'>");
}

robinmofo’s picture

My blocks grippie was also missing... after searching google and drupal.org for a half hour I came across this post.. I thought it was going to be my theme... but I had just copied some jquery code into my page.tpl .. and removing the reference to the additional jquery class sorted it out. Thanks internetman!

FR6’s picture

I had the same problem: The handles to reorder the blocks into the admin page and to reorder the fields into a content type in CCK had suddenly disappeared.

What I tried:

-Verify that the file "misc/tabledrag.js" have not been corrupted. No.

-Verify if the handles reappears when I switch to another theme. No.

The only solution that I found is to hack the code into "misc/tabledrag.js" at line 178:

if ($('td:first .indentation:last', item).after(handle).size()) {
  // Update the total width of indentation in this entire table.
  self.indentCount = Math.max($('.indentation', item).size(), self.indentCount);

  //hack Forcing the draggable handles
  $('td:first', item).prepend(handle);
  //---

}

Until I find another solution I will use this solution.

I use Drupal 6.16.

FR6’s picture

Another thing to verify is that the module "Theme Developer" is deactivated.

tondeuse’s picture

All I had to do to resolve this issue was to remove the call to my own copy of jquery in page.tpl.php, as it was already being injected into the page via the print $scripts; tag in the head. The handles immediately reappeared in the block admin page. Thanks for the solution.

faunt’s picture

Verifying this simple fix worked for my custom theme. Thanks.

David Vespoli’s picture

...was also what I was experiencing. I modified the previous poster's solution by adding this to my theme's jQuery to prevent loading it twice:

if(typeof $ != 'undefined') {
	return null;
}
okokokok’s picture

I'm cleaning up a broken theme delivered by a subcontractor, which also suffered from a broken tabledrag. I fixed this by uncommenting ;scripts[] = js/jquery-1.4.2.min.js in brokentheme.info - and I'll probably use http://drupal.org/project/jquery_update if jQuery >1.3 is actually needed.