I just installed the current version of thickBox and have been experimenting a bit. (CCK1.5 & Imagecache) So far I like what I see, but have a question on how to integrate it in my custom Theme.
First it is installed and working (I activated the login and image options). I tested the login and default image-cck functionality and they work. But instead of using a generated page with CCK image fields in it, I wish to use my own theme for the node (node_project.tpl.php) Now when I let CCK generate the layout there is an option in the display panel that lets me specify that the image field is to be processed using ThickBox. The problem is that if I specify my own node template for the page that option calling ThickBox doesn't seem to come into play. I thought that since I wanted to use it in conjunction with ImageCache, If I went to the ImageCache page I'd see the name of the preset that integrates ThickBox and I would replace my old one with that name. But I see no new presets mentioning ThickBox.
When I look at the generated HTML(from the browser) for the page that contains the CCK generated display code. I see a class="thickbox" added to the IMG statement. Is this the only update required? Or is there more that I have to integrate into my Theme?
My current code to include the pics is:
<p align="center">
<?php if ($field_photo_1[0]['view']):
print theme('imagecache', 'project_intro_images/'. $field_photo_1[0]['filepath']);
endif; ?>
<?php if ($field_photo_2[0]['view']):
print theme('imagecache', 'project_intro_images/'. $field_photo_2[0]['filepath']);
endif; ?>
</p>How would I update it to activate ThickBox for these images?
Thanks for any help
Comments
Comment #1
dorien commentedI have the exact same problem with
Comment #2
marcel.klimo commentedyou need to set the class of the anchor to "thickbox"
Here's a quick mockup of how to do it:
Comment #3
dorien commentedThanks,
I'll keep that in mind.
What did the trick for me is:
Whaaw... why look so far. If you set the display options in the content type, you don't need to worry about it in the theme!
Excellent module!
Comment #4
frjo commentedComment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
nashINATOR commentedHi!
I tried using the code above on a page node-tolet.tpl.php as :
:( it doesn't work. It gives me a link to the image. When I edit page source I see:
indicating that it is inserting the
<imgas html friendly "& lt;" also thickbox doesn't work.Help! anyone, I have been looking at this for far too long besides I am a noob!
Thanks in advance.
Nash
Comment #7
nashINATOR commented:D Hacked it work. Very very very rough but it works. I wanted to create an image gallery where it selects the first image in the array and uses it as a primary image and the others as secondary images with imagecache controlling the sizes and thickbox displaying the images.
Hope it's helpful to someone.
regards,
Nash