Is is possible to make the images in node teasers and node pages to have different link behaviors? I would like thumbnails in teaser not to have any links and for the same thumbnails in node pages to have active links. Maybe I could switch off image links in teasers by some kind of theming (via .css)? I just can't figure out how to achieve this effect.

CommentFileSizeAuthor
#6 swaplink.txt609 bytesjferjan

Comments

yngens’s picture

Probably I need to provide little more detailed explanation.

Image Assist gives number of choices for link behavior such as "Not a link", "Link to image page", "Open in a pop up window" and "Go to URL", which seems quite satisfactory. And actually number of options are satisfactory except for the case when you want to get different behavior for the same image in the body of nodes and in the teasers. I don't want the users of my site to deal with placing two different codes for images in two different places - in the body of the node and separately in the teaser field. In fact I do not have any additional module installed for generating custom teasers, so all my teasers are generated on normal default Drupal way. So if a user places a picture via img_assist with a "Link to image page" on in the beginning of the text, then that pictures also goes to the teaser for this node. And it is not very comfortable to have images with active pictures on the front page - at least for me, I really do not like the visitors of my site to leave to image node page before they have a chance to read the whole text of the node.

Could anyone share on how to make img_assist to strip out any links for the code which goes to the teasers, please.

zoo33’s picture

Status: Active » Postponed

I don't think this is a feature that will be implemented anytime soon unless someone steps up and provides a really good patch for it. It's a reasonable request, but right now we need to get rid of a number of reported bugs and publish a new stable release.

In the meantime, you can work around the problem in a couple of ways. If you write your own custom module(s) for your site, you could add a preg_replace() to hook_nodeapi() on $op == 'view' to strip the anchor tag from the teasers. Or, in you're theme, you can use _phptemplate_variables() to do the same thing, on $vars['content']. Don't know if that's helpful to you but those are the possible solutions I would consider. Maybe there's a simpler solution.

yngens’s picture

thank you, zoo33. unfortunately i am not that good to implement your suggestion into a module. so i will just be looking into future this request to be realized some day. bkz as you noted this is a reasonable request - pictures in the teasers should not have active links, or it should be optional to node creator - to make them clickable or not.

jferjan’s picture

subscribing...

I have the exactly same feuture request. You can see the problem in action here: http://www.drm-drustvo.si

mrgoltra’s picture

subscribing...

jferjan’s picture

StatusFileSize
new609 bytes

Ok i made a workaround as suggested by zoo33. The regex is messy and modified to suit my needs so you should probably replace it.

talski’s picture

Assigned: Unassigned » talski
Category: feature » support

Hi Jferjan, i'm new to drupal and i don't know how do i use this swaplink, can you explain me?

sun’s picture

Category: support » feature
Status: Postponed » Closed (won't fix)

Actually, this is impossible to implement currently. Image Assist is an input filter, and input filters are invoked without any context. Thus, a node's content is filtered and stored only once for all views. See http://api.drupal.org/api/function/hook_filter/5

The only option I can currently imagine is to create a separate field for the teaser using CCK.

jferjan’s picture

@talski

1. download swaplink.txt
2. rename it to swaplink.module
3. copy it to your modules folder
4. enable swaplink module in drupal

it works only with clean urls DISABLED.
If you need a version for clean urls, just modify the regex.