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

Comments

ppblaauw’s picture

Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)
blingximus’s picture

Priority: Normal » Major
Status: Postponed (maintainer needs more info) » Active
blingximus’s picture

This 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

ppblaauw’s picture

Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

Do 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.

if ($vars['imgcache_slide'] <> '<none>' && module_exists('imagecache') &&  is_array(imagecache_presets())){
  $slider_items[$key1]['slide_image'] = 
  l(theme('imagecache', 
          $vars['imgcache_slide'], 
          $filepath,
          check_plain($result->node_title)),                  
    'node/' . $result->nid,
    array('html' => TRUE,) // needed, Whether the title is HTML, or just plain-text. TRUE for HTML
  );
}
else {          
  $slider_items[$key1]['slide_image'] = 
  l('<img src="' . base_path() . $filepath . '" alt="' . check_plain($result->node_title . '"/>'),                  
    'node/' . $result->nid,
    array('html' => TRUE,) // needed, Whether the title is HTML, or just plain-text. TRUE for HTML
  );
}      
blingximus’s picture

In 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....

ppblaauw’s picture

You have the HTML page, you can probably best find out what is wrong.
Its rather difficult to debug from a screenshot.

blingximus’s picture

The 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?

blingximus’s picture

ok heres the link to my front page

http://supply.dyndns-web.com/delta/

ppblaauw’s picture

Assigned: blingximus » Unassigned

can you now enable the code with: array('html' => TRUE,)

blingximus’s picture

Assigned: Unassigned » blingximus

OK, so I added it, but it didnt get all messed up this time, but the images still dont show

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,array('html' => TRUE,));
            }
            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,array('html' => TRUE,));     
            }          
          }
ppblaauw’s picture

I don't see any difference, the img tag is still visible as plaintext.

blingximus’s picture

Check it out now

ppblaauw’s picture

The 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) . '"/>'

if ($vars['imgcache_slide'] <> '<none>' && module_exists('imagecache') &&  is_array(imagecache_presets())){
  $slider_items[$key1]['slide_image'] = 
  l(theme('imagecache', 
          $vars['imgcache_slide'], 
          $filepath,
          check_plain($result->node_title)),                  
    'node/' . $result->nid,
    array('html' => TRUE,) // needed, Whether the title is HTML, or just plain-text. TRUE for HTML
  );
}
else {          
  $slider_items[$key1]['slide_image'] = 
  l('<img src="' . base_path() . $filepath . '" alt="' . check_plain($result->node_title) . '"/>',                  
    'node/' . $result->nid,
    array('html' => TRUE,) // needed, Whether the title is HTML, or just plain-text. TRUE for HTML
  );
}      
blingximus’s picture

bwaahahahaha 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.

ppblaauw’s picture

Title: Linking Images with Advanced Slideshow » Linking Images with Advanced Slideshow (Fixed)
Assigned: blingximus » Unassigned
Status: Postponed (maintainer needs more info) » Fixed

Adjusted the snippet at ddblock.myalbums.biz
Set status to fixed.

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