Ah- the single entry page thing. Keep in mind, when you use the weblog tag, it’s ‘looping through’ results. So say you have the weblog tag displaying the last five entries. IF you nested the gallery tag inside, it will be part of the loop- and basically you end up with the equivilant of using the gallery tag 5 times. That’s a pretty good hit to the database.
So- if you are using the weblog tag to show a single entry- for example, a permalink or comment page- then having the gallery tag inside the weblog tag is no big deal. You are only ‘running it’ once. But if you’ve got it nested inside a tag that’s returning say 20 entries- that’s a lot of added queries and likely to slow things down.
It’s always good to keep aware of how the weblog tag works when you start nested queries inside it.
And I dug up the extension- it was a real ‘quickie’- no settings interface and it was designed to pull categories from a single gallery. Could be expanded if needed, so give a yell if that’s necessary. You’ll need to open up the extension- and on line 33 alter:
$alter_field = 32;
The number? That should be the field id of the text field where you want the category id to be inserted. That field will be ‘replaced’ on the user side by a dropdown filled with the category names.
On line 37 you’ll need to alter:
$results = $DB->query("SELECT cat_id, gallery_id, cat_name FROM exp_gallery_categories WHERE gallery_id=2 ORDER BY cat_name");
Change gallery_id=2 to equal the id number of whatever gallery you want to pull the categories from.
Change it, save it, upload it to the extensions folder- then enable the extension. Should work. Like I say- was a quicky. But it should do the trick unless you have multiple galleries you need to draw from. Easy enough to modify it if that were the case.