Hi,
I have been trying to make images link to another page using the advanced slide show, im currently using custom templates and custom pagers. I initially tried the "learn more" option, but this isnt user friendly enough and would like to have the actual images link to the source.
I have tried employing different methods with varying degrees of success, below is my code in the template.php file
if (module_exists('imagecache') && is_array(imagecache_presets()) && $vars['imgcache_slide'] <> '<none>'){
$slider_items[$key1]['slide_image'] =
l(theme('imagecache',
$vars['imgcache_slide'],
$filepath,
check_plain($result->node_title)),
$result->node_data_field_pager_item_text_field_url_value);
}
else {
$slider_items[$key1]['slide_image'] =
l('<img src="' . base_path() . $filepath .
'" alt="' . check_plain($result->node_title .
'"/>'), $result->node_data_field_pager_item_text_field_url_value);
}
} this links each slide to its destination page but the IMAGES themselves dont appear anymore, only the "Link" to the image, i tried setting it to recognize html using
"array('html' => TRUE,)"
But this caused the images to display in top down layout on top of each other, messing up the whole slideshow. please help. T_T
| Comment | File | Size | Author |
|---|---|---|---|
| true_html_gallery.JPG | 93.8 KB | blingximus | |
| gallery_screenshot.JPG | 27.25 KB | blingximus |
Comments
Comment #1
ppblaauw commentedSee How to link image in the slide to a node? snippet at http://ddblock.myalbums.biz/preprocess_snippets
Hope this helps you further, please let me know.
Comment #2
blingximus commentedComment #3
blingximus commentedThis is actually where I got the original code from, the slideshow comes out unformatted when I copy and paste this into my template.php file
Comment #4
ppblaauw commentedDo you have a link to the slideshow?
Is the image HTML tag shown on the page?
You need to use array('html' => TRUE) in the l function, otherwise the l function will transfer to plaintext and remove the img tag.
Comment #5
blingximus commentedIn my original post you will see I posted two screenshots:
1) The First screenshot is without the array('html' => TRUE) function, as you can see the plaintext is what shows up and the image is removed.
2) The Second screenshot is when I used the array('html' => TRUE), as you can see the images appear but the slideshow looks totally messed up now.
thanks for your help thus far....
Comment #6
ppblaauw commentedYou have the HTML page, you can probably best find out what is wrong.
Its rather difficult to debug from a screenshot.
Comment #7
blingximus commentedThe website is on a local network at work, and I cant get the required permissions to post it on a free server. I'd have to carry it home and do it later, is there anything else I can give you in the mean time?
Comment #8
blingximus commentedok heres the link to my front page
http://supply.dyndns-web.com/delta/
Comment #9
ppblaauw commentedcan you now enable the code with: array('html' => TRUE,)
Comment #10
blingximus commentedOK, so I added it, but it didnt get all messed up this time, but the images still dont show
Comment #11
ppblaauw commentedI don't see any difference, the img tag is still visible as plaintext.
Comment #12
blingximus commentedCheck it out now
Comment #13
ppblaauw commentedThe end tag of the img is plain text:
can you try the following:
check_plain($result->node_title . '"/>')
should be:
check_plain($result->node_title) . '"/>'
Comment #14
blingximus commentedbwaahahahaha it works, you can check it and see, I just need to set the url paths and should be good.
To clarify I copy and pasted your code again and it worked! thanks for your help.
great module. Hopefully I wont have anymore issues.
Comment #15
ppblaauw commentedAdjusted the snippet at ddblock.myalbums.biz
Set status to fixed.