Hoping against hope that I'm missing something, but here goes.

I'm using the image_attach block to display an attached image alongside a node, in the sidebar. Is there a way to theme that block to remove the link to the image node?

I've looked through image_attach.module, and I can't see a themeable function that looks like it would do the trick. I've actually played with a bunch of them, but they don't seem to have an effect on the block.

Failing that, is there a way to get the attached image to display in a sidebar block without the link? Can anybody point me to a snippet?

CommentFileSizeAuthor
#12 445074.image_attach-theme-block.patch2.28 KBjoachim

Comments

escoles’s picture

I've worked around this by creating a block over-ride template for image_attach and disabling the href by search and replace, thus:

<?php print str_replace('</a>', '</span>', str_replace('<a ', '<span ', $block->content)); ?>

This does seem to me to be an awkward approach, though, in a couple of ways. I'd still like to know if there's a more efficient way to theme away this link, which I have a hard time imagining wanting in any application where I'd use image_attach (and especially the image_attach block).

joachim’s picture

Title: Is there a way to theme the image_attach block display? (Need to remove link.) » Add a theme function for the attached image block.
Category: support » feature

Yeah, lack of a theme function here is a bit rubbish.
If you feel able to provide a patch, please do :)

joachim’s picture

On the other hand, I'd like to get more views support into this module, so the block could get provided with a view in the near future :)

escoles’s picture

My holy grail is to be able to do a complete integration without having to code anything but stylesheets. So a view might be a better approach. But (and maybe it's just that I haven't worked with the new Views enough) how would you match the attached image to the current node?

As for contributing a patch myself: I doubt you'd want to use it if I did. Seriously ;-).

2noame’s picture

I'm stumped with this same puzzle. Is there any way to match a thumbnail of the node's image within an adjacent block using Views? I can't figure out a way. I'd use the attached images block, but that one doesn't even show. Plus I'd prefer finding a Views method for more control.

joachim’s picture

> I'd use the attached images block, but that one doesn't even show.

Try the latest beta. We fixed that bug.

> Plus I'd prefer finding a Views method for more control.
I've not checked views is working okay with the new multiattach stuff.... might be a bug to fix :)

2noame’s picture

I'm confused. I installed beta1, had been using alpha6, but when I went to use update.php, it showed as no updates available for any of the image modules. I ran it anyway as I always do when having uploaded a new module version but still the attached images block does not appear in the right-side area where I put it. So then I made it manually update attached_images in update.php to 6102, and got the error:

"user warning: Duplicate column name 'weight' query: ALTER TABLE image_attach ADD `weight` INT NOT NULL DEFAULT 0 in /drupal/includes/database.mysql-common.inc on line 298."

But I figure that's just because I made it re-run 6102 when I didn't need to, right? So how do I get this to show? Do I have to manually make update.php update the rest of image? If so, why doesn't it just do that automatically when I run update.php?

joachim’s picture

Yeah, that'll be because you re-ran it.
See http://drupal.org/node/426724 for how to fix this now.

2noame’s picture

I'm sorry, I don't understand just what to do to fix this. I tried running that patch but it fails. Do I need to change something manually in the module code itself?

Just to confirm, my problem is not making the block appear in the admin page. I see it there and have assigned it to display on the right-hand side of my site. It's just that it never actually shows up where it's supposed to. This patch seems to only fix it appearing in the admin page?

alanburke’s picture

Assigned: Unassigned » alanburke
joachim’s picture

Assigned: alanburke » Unassigned

Please go see that issue and comment there, not here.

joachim’s picture

Status: Active » Fixed
StatusFileSize
new2.28 KB

Committed the attached patch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nikhilpatilnp’s picture

Title: Add a theme function for the attached image block. » css file in block
Project: Image » CSS
Version: 6.x-1.0-alpha4 » 6.x-1.0-rc1
Component: image_attach » Code
Assigned: Unassigned » nikhilpatilnp
Category: feature » support
Priority: Normal » Critical
Status: Closed (fixed) » Active

hey friends i m totally new in drupal i m trying to explore it more
now according to my project i have to add a menu bar in drupal
i m using drupal-6.15 so i made a menu bar in block and made it appear to all page but
i want to include the css of that menu pls help me how to include the css in the drupal
pls i got very less time for my project

and yes sorry for spelling mistake

joachim’s picture

Title: css file in block » Add a theme function for the attached image block.
Project: CSS » Image
Version: 6.x-1.0-rc1 » 6.x-1.0-alpha4
Component: Code » image_attach
Assigned: nikhilpatilnp » Unassigned
Category: support » feature
Status: Active » Closed (fixed)

Please don't repurpose closed issues. I suggest you ask on the forums.

joachim’s picture

Priority: Critical » Normal

Oh and it was set to 'normal' too before you mucked about with it :/

fax8’s picture

@nikhilpatilnp I second joachim comments. Moreover CSS module issue tracker is only for issues using the CSS module. If you want help creating your CSS files please ask here: http://drupal.org/forum/3