Download presentation
Presentation is loading. Please wait.
Published byPriscilla Crawford Modified over 8 years ago
1
Dan Hakimzadeh http://agaric.com @dhakimzadeh
2
Agenda ● A Fistful of Photos ● For a Few Photos More ● The Good, The Bad, and The Templates
4
CCK - http://drupal.org/project/cck -- IMAGEFIELD - http://drupal.org/project/imagefield -- DATE - http://drupal.org/project/date IMAGECACHE - http://drupal.org/project/imagecache LIGHTBOX - http://drupal.org/project/lightbox2 NAT - http://drupal.org/project/nat VIEWS2 - http://drupal.org/project/views The Modules
5
Setting Up 1 – make content types – EVENT (title, date) – IMAGE (title, imagefield) 2 – make vocabulary for tagging IMAGE content type (galleries) 3 – link NAT and events, so each new event creates a matching term under our galleries vocabulary 4 – make some imagecache presets
6
Building the view, finally...
7
Style == HTML List Items to display == 8 Sort == Random Filter by published IMAGE content type THE FIELD FORMAT!!!
9
But is that really how we want to do this? Only 8 photos?! What if we make the photos link to their gallery pages and run lightbox from there?
10
Make gallery pages
16
Problem This will output http://alpharoad.com/photos/TERMNAME Like http://alpharoad.com/photos/generalhttp://alpharoad.com/photos/general - OK http://alpharoad.com/photos/KC's Pub & Grill - BAD
17
We want to do it with Term ID not Term Name coz that's how the cool kids do it
18
Time for some ninja skillz
21
● Go to theme folder ● Make a file named: “views-view-field—PhotoBar--block-1--name.tpl.php” ● Paste that stuff into it (the template) “ views-view-field.tpl.php” ● Modify to the limits of your imagination
25
5:34 PM me: using <?php $data = $row->$term_data_tid; print $data; ?> in my tpl BUT http://alpharoad.agariclabs.com:81/ 5:35 PM i3iviivi: what is on line 26, and did you update? 5:37 PM me: line 26 is $data = $row->$term_data_tid; 5:38 PM i3iviivi: oh god damn you NO DOLLAR SIGN NO VARIABLES INSIDE VARIABLES
28
Run through most of the same steps, blah blah, create a file named: “views-view-field—PhotoBar--block-1--field-image-fid.tpl.php” Paste that stuff into it Modify and make it awesome, in this case we make the thumbnail a link to it's gallery page
31
Other uses
33
conclusion You could be like D.A.R.Y.L
34
Dan Hakimzadeh http://agaric.com @dhakimzadeh
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.