I am trying to overlay the node title on the image using the textactions. "return $node->title" entered in text box and "Evaluate text as PHP code" box is checked. I am using cck imagefield for images. I get an error:

Table 'lsmonroe.image' doesn't exist query: SELECT nid FROM image INNER JOIN files AS f WHERE f.filepath = 'sites/default/files/saddle.jpg' LIMIT 1 in C:\xampp\htdocs\lsmonroe\sites\all\modules\imagecache_actions\textactions.inc on line 264.

Not sure if it is a bug, a problem with imagecache, a problem with imagefield or the sytax "return $node->title"

Comments

dman’s picture

The image it is looking for is an image.module image node. That is the $node that gets loaded.
AFAIK there is no explicit support for imagefield. However, the code certainly should be a bit more careful before making that database lookup!

Imagefield doesn't have much extra metadata attached to images (last time I looked) - although I guess 'title' is certainly useful.
Can anyone suggest the appropriate SQL to get the title from a filename? Or the parent node? (I don't use the imagefield approach). It should be pretty easy, and would be what you can paste into the custom code field.

I'll definitely remove the dependency on image.module in the next roll (but not the support).

ndwilliams3’s picture

The nid for the associated node is in the imagefield array, so it should be possible to work backwards to get the node title. However , that is above my php knowledge level! Any help would be appreciated.

MedicSean37’s picture

Yeah I would like to use return "$node->title;" for a node that use imagefield.

Subscribing

dman’s picture

Title: problem with dynamic Textactions » imagefield support wanted for dynamic Textactions
Category: support » feature

Anyone that is using imagefield can please have a look at what is needed for this.

I'm not using it, at least not in this way, but would be happy to review any contribution that does the job efficiently.

ablewave’s picture

subscribing

asak’s picture

subscribing. what i need is $node->nid .

dman’s picture

Status: Active » Closed (duplicate)

Fixed in dev. Please try it out.
http://drupal.org/node/363434