By clandmeter on
Hi,
I am trying to theme a CCK node with image_field which displays a picture from imagecache preset and links to another imagecache preset which is the same picture but bigger with the preset name image_view. I want to use lightbox2 to view the image_view picture.
<a href="link/path to imagecache image_view picture" rel="lightbox">
<?php print theme('imagecache', 'image_thumb', $field_photo[0]['filepath']); ?>
</a>
What is the best way to get the link/path to the image_view preset?
Comments
not a pretty solution
This isn't very pretty but it works for me:
There i even put your variables into it.
What would be really nice is a way of directly calling an imagecache theme such as:
html to just have the $url returned... anyone got any ideas on how to do this?
theme('imagecache_path', 'image_view', $field_photo[0]['filepath']);and instead of being given the
A slight variation on your
A slight variation on your solution, which breaks out the href for the right larger image and uses an imagecache function to create the url.
I came to this solution to assure flexibility if the default files directory changes. Using the preset names instead of hardcoding links assures things don't break. Or, in my case, unbreaks what I broke when I changed my files directory.
Andrew Mallis
http://andrewmallis.com
Andrew Mallis
CEO & co-founder @ Kalamuna