Posted by general need on July 18, 2009 at 3:17am
Jump to:
| Project: | Inline |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
This module is perfect for my needs: it makes great teasers with inline images. Is there any easy way to get the image in the teaser to link to the node?
Comments
#1
Hi!
I managed to do this by changing the "inline_upload.module" code for the Option ":
"Display image with a link to the image file".
It would be great to be possible create a 3rd option: "Display image with a link to the node"
Well this how I did it:
I'm using the "Auto-Inline" option (No [inline:...] in the text) so in the "inline_upload.module" code I've changed:
$output = l($output, $url, array('attributes' => $attributes, 'html' => TRUE));For:
$output = l($output, $GLOBALS['base_url'] . '/node/' . $file->nid, array('attributes' => $attributes, 'html' => TRUE));}
I would like to find a way to change ". '/node/' for some variable for other options.
Also just the "ALT" or Title doesn't return the name of the file I changed:
$title = (!empty($file->title) ? $file->title : (!empty($file->description) ? $file->description : $file->filename));for
$title = 'Go to...';Please let me know if you find a cleaner way to do this and also don't show the link when you are already inside the Node.
I hope it helps.
I'm still testing it :)
Regards,
Ricardo
#2
I suggest
$output = l($output, 'node/' . $file->nid, array('absolute' => 'TRUE', 'attributes' => $attributes, 'html' => TRUE));for link to use Drupal path aliases.