G2 uses smarty as the template engine. on top of it, we have our own smarty plugins and a lot of stuff. but basically, it's a a unmodified smarty engine. http://smarty.php.net/
you could write a FAQ module for g2 (to add new faq entries dynamically) or just use the static html page for it.
if you want to use G2 templates outside G2, you should use GalleryEmbed to initialize g2 and then you can display the resulting page anywhere in your website.
paulbearne
Joined: 2005-08-01
Posts: 87
Posted: Mon, 2005-08-08 07:56
Ok I need to run the G2 in as an emdebed gallery
Has abody got any code that pulls the theme out to extnal page with static / otherwise content
Paul :P :P
valiant
Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-08-08 09:12
see GalleryEmbed::getImageBlock().
It makes something like this:
/* Load the G2 templating engine */ GalleryCoreApi::relativeRequireOnce('modules/core/classes/GalleryTemplate.class');
$template = new GalleryTemplate(dirname(__FILE__) . '/../../..'); // this is the path to the gallery root dir
$template->setVariable('l10Domain', 'module_' . $moduleId); // this can be omitted, it's for translation
// here you should generate the dynamic content
// then you can let the template know of it by
$template->setVariable('varName', $variable);
$tpl = 'modules/imageblock/templates/ImageBlock.tpl'; // path to your smarty template
/* Render and get the page */
list ($ret, $html) = $template->fetch("gallery:$tpl");
if ($ret->isError()) {
return array($ret->wrap(__FILE__, __LINE__), null, null);
}
/* Check for any css required */
$head = $template->getVariable('head');
if (!empty($head['tpl'])) {
list ($tpl) = each($head['tpl']);
list ($ret, $headHtml) = $template->fetch("gallery:$tpl");
if ($ret->isError()) {
return array($ret->wrap(__FILE__, __LINE__), null, null);
}
}
Posts: 32509
G2 uses smarty as the template engine. on top of it, we have our own smarty plugins and a lot of stuff. but basically, it's a a unmodified smarty engine.
http://smarty.php.net/
you might be interested in the static html pages module of g2:
http://codex.gallery2.org/index.php/Gallery2:UserContributions#Modules
you could write a FAQ module for g2 (to add new faq entries dynamically) or just use the static html page for it.
if you want to use G2 templates outside G2, you should use GalleryEmbed to initialize g2 and then you can display the resulting page anywhere in your website.
Posts: 87
Ok I need to run the G2 in as an emdebed gallery
Has abody got any code that pulls the theme out to extnal page with static / otherwise content
Paul :P :P
Posts: 32509
see GalleryEmbed::getImageBlock().
It makes something like this: