I cannot figure out what the image reference block in 4.7 is supposed to do. I thought it would be like the book navigation block and display some additional choices for images, but nothing is displayed even when I am in the galleries or for individual images.

Can anyone explain what this block is for?

I am logged in as user 1 and have given myself all permissions available. I have img assist, image, image import, image attach and image gallery all turned on. I have set up two galleries, one with a single image and one with four images. I have not set up sub-galleries yet (can this be the issue?).

thanks,
ambereyes

Comments

Gman’s picture

I have this exact same question as well. Any help would be appreciated.

-Gman

jax’s picture

Which module provides this block? Acidfree?

ambereyes’s picture

I do not have acidfree. And I am not sure which module supplies the block. I am not that conversant in php, so I am not even sure where to look. The only image modules I am using are image, image galleries, image attach, image assist and image import.

thanks for responding,
ambereyes

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Glenda: "Are you a good witch or a bad witch"
Katrina: " ... whatever ..."
www.katrinamessenger.com

PAAHCweb’s picture

Don't know about 4.7 exactly; some time back I searched quite a while for the answer. Finally found two explanatory lines in the 4.6 img_assist module:

* Generates a block that references the other places the current image is used.
* The block is only visible when looking at the full view of an image.

I enabled the block, but haven't seen it yet. Since "allow users to view full version" is unchecked somewhere in my image settings (don't recall where), I doubt if I'll ever see this block. I should probably disable it, but it doesn't seem to be doing any harm.

HTH,
D. Lynn

ambereyes’s picture

Wow. I wonder if anyone has actually seen this block in action. Thanks for the info. I am setting up my second Drupal site, for a visual artist. I was hoping it would provide some fuunctionality she maybe could use.

Oh, well. I'll consider it a legend, along with big foot and Nessie ... kind of funny though.

ambereyes

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Glenda: "Are you a good witch or a bad witch"
Katrina: " ... whatever ..."
katrinamessenger.com

jax’s picture

The reason that you have not seen it is because the block does not work without mod_rewrite.

        $uri = parse_url(request_uri());
        $nid = array_pop(explode('/', $uri['path']));

results in a empty nid without mod_rewrite and in cases when the last argument in the url isn't the node id.

If you look how it's done in the profile.module it seems that the node id can be retrieved with arg(1). If you replace the lines above with:

$nid = arg(1);

It should work. But then it seems img_assist_get_references also does not function. This leads us to img_assist_map_load which uses the query

SELECT * FROM {files} f INNER JOIN {img_assist_map} i ON f.fid = i.iid WHERE f.nid = %d

which returns no results, because it should be

SELECT * FROM {files} f INNER JOIN {img_assist_map} i ON f.nid = i.iid WHERE f.nid = %d

And voila! The "Image reference" block in all its glory! Enjoy :)

This should be turned into a patch and submitted to the img_assist module. But to make it a good patch, what is the recommended method for retrieving the node id from the path?

gollyg’s picture

I have been wondering about the best way to retrieve the node id from a page. I have ended up using the url, but it would be a great addition to the api to have a function that returns an id for the current page. I guess some pages generated by things like the taxonomy module would not actually have node ids, but the function could simply return false.

I have written my own hacked implementations, where I grab the url, run it though the drupal_lookup_path function, and then check that arg(0)=="node" and retrieve arg(1). But i am sure that there is a better way?

jax’s picture

ambereyes’s picture

I had sort of given up. I went ahead and told my user that the site was ready.

I should probably wait for the updated module at this point...or... I could be brave and try and patch it myself ... hmmm.

I really appreciate your help with this nonetheless.

Thanks!

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Glenda: "Are you a good witch or a bad witch"
Katrina: " ... whatever ..."
katrinamessenger.com

anawillem’s picture

i want to make those changes (for 5.x) and don't know if you are referring to the img_assist.module or another file. can you let me know?

Thanks,

aw

--
anawillem
http://jellobrain.com

anawillem’s picture

Want to make those changes (for 5.x) and don't know if you are referring to the img_assist.module or another file. Can you let me know?

Thanks,

aw

--
anawillem
http://jellobrain.com