I'm using imagecache, imagefield, views and taxonomy to create image galleries by album. I love the flexibility of this setup, however, I need to create a summary page of all of my albums (vocab terms) ordered by date of creation. (I use a free tagging vocabulary to create the albums and assign this to a group of images using imagefield_import). After following several other threads, I came across the suggestion at http://lasqueti.ca/books/design-notes/image-gallery-summary-view. Although this works beautifully to create a summary of my albums, I can only sort the albums alphabetically and not by created date. It seems that this might be impossible to do using my current setup.
If that is the case, I am more than willing to try another solution. Does anyone know of a setup (image_gallery, acidfree, brilliant_gallery, etc.) where I can create image galleries by album, present a summary of my albums, and have this summary sorted by the creation date of the album? In addition, I need some way to bulk import images (something similar to imagefield_import).
I appreciate your suggestions!
Comments
Fixed it - mostly
I've modified the code at http://lasqueti.ca/books/design-notes/image-gallery-summary-view to sort by date by creating
$sortby=array()before
foreach ($nodes as $query) {and then replacing the end of the loop (I've kept the first line the same so that you can easily reference where to insert this) with the following code:
Hopefully this is helpful to someone! One final question to bounce off of anyone who reads this - this code limits the number of summary galleries to the number of images I have set to display per page in my view. For example, I have set in my view to display 12 photos per page with a pager; consequently, only the 12 most recent albums show on my summary album page - there is no pager on this page.
I thought that I might could fix this by changing the false to true in
$result = views_build_view('items', $view, array($arg), false, 1);but this only messed things up. Any ideas how I could add a pager so that my summary album page will show all of my albums?
Please help with SQL code
Previously I was able to create a themed album summary view ordered by date by modifying the above code. However, it was difficult to add pagers to this summary view, so I have rewritten the code using SQL. I'm not an expert on SQL, so I would appreciate you looking at my code for a moment and letting me know if it looks reasonably efficient (or if there are any glaring efficiency problems).
Given the lack of response on this thread, I don't have much hope that anyone will read this . . . but it's worth a shot.
Thanks!