Hi.
My first extension release.
This extension creates a new Custom Field, Full Gallery, which allows you to relate a full gallery to a weblog entry.
Not submitting it yet to the Extensions lib, since I have to go over the whole checklist (ie: I can’t guarantee it works under php 4.3, but afaik, it should).
Either way, thought some people might find it handy (well, i did for this one project).
Some usage docs are in the comments, so check that out.
Has the ability to exclude gallerys from the drop down (see the extension settings).
Feedback please if you see me doing anything wrong, or ways to improve it - still learning EE.
Basically stores the Cat ID of the gallery you relate to, and then you can pull it out and do what you will with it. Handy for one gallery page, which dynamically populates based on the cat.
Here’s a copy of the helper I use to pull the gallery short name for the gallery tag. the default gallery short name is set in the function, so you would want to mod it for your needs.
/**
* Returns a gallery short name from a given gallery category id.
* Defaults to page_content
* @param int $cat_id
* @return string
**/
function get_gal_shortname($cat_id = 0)
{
global $DB;
$sql = "SELECT gal.gallery_short_name
FROM exp_galleries AS gal
INNER JOIN exp_gallery_categories AS gc ON gc.gallery_id = gal.gallery_id
WHERE gc.cat_id = '{$cat_id}'";
$result = $DB->query($sql);
if($result->num_rows > 0) {
return $result->row['gallery_short_name'];
} else {
return 'page_content';
}
}
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.