It would be very nice if there would be a possibility to choose the layout/theme (default or per album) when embedding G2. Maybe the init call of the GalleryEmbed class could be used for that.
Does someone know a way to choose dynamically the layout and/or theme of an album?
Thanks
Posts: 1378
You might want to follow this thread -> http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=29180
Posts: 17
I've found a temporary solution:
In the layout.inc file of my own layout called clean, I use
if (GalleryUtilities::isEmbedded()) { /* Add our header and styles */ $template->head('layouts/clean/templates/head.tpl'); $template->style('templates/layout.css'); $template->style('layouts/clean/layout.css'); return array(GalleryStatus::success(), 'layouts/clean/templates/albumBody.tpl'); } else { /* we use matrix layout for standalone */ $template->head('layouts/matrix/templates/head.tpl'); $template->style('templates/layout.css'); $template->style('layouts/matrix/layout.css'); return array(GalleryStatus::success(), 'layouts/matrix/templates/albumBody.tpl'); }so that for the standalone instance of G2 the matrix layout is used and the clean layout otherwise. This is not a very nice solution but it works for now.
Doing the same trick with default theme selection unfortunately doesn't work, but one can choose its own css file while embedding anyways.