ImagePlacement

caktux - May 6, 2009 - 19:39

Allows drag'n'drop placement of Imagefield/Imagecache images into nodes by providing a "Place images" local task right beside the normal "Edit" link of a node. For the moment it is limited to floating left and right and getting placed to the top or bottom of the node's body, inserting into paragraphs will be coming soon.

Installation

First follow normal module installation procedures. Then you'll need to modify your node.tpl.php file slightly to make the container div have a different element ID if it's a teaser or full node. Don't worry, it's pretty easy and shouldn't break your theme, if so, it's probably already broken ;) You need to change what probably looks like:

<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?>">

To:
<div id="node-<?php print $node->nid; ?><?php if ($teaser) { print '-teaser'; } ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?>">

What we're doing is simply adding <?php if ($teaser) { print '-teaser'; } ?> to make sure that full nodes get an element ID of "#node-nid" and teasers get "#node-nid-teaser". That way, when displaying a list of nodes as full nodes or teasers, imageplacement can determine from the DOM what image placement setting it needs to apply to a node. See #457122: Node preview creates the DOM element #node-nid twice for details on this issue.

Downloads

Development releases

Version Downloads Date Links
6.x-1.x-dev Download (23.64 KB) 2009-May-08 Notes


 
 

Drupal is a registered trademark of Dries Buytaert.