hello,
i am developing a gallery 2 book theme and need to pass to album.tpl an array of text fields
in theme.inc i add an array to params
Quote:
function BookTheme() {
global $gallery;
...
$this->setParameter('page_tpl', array('index.tpl', 'intro.tpl', 'chapter1.tpl'));
}
in album.tpl i try to print out the values from the array
Quote:
{foreach from=$theme.params.page_tpl item=tpl}
<div>{$tpl}</div>
{/foreach}
but the only thing that gets printed out on the page is word
please help the newbee
Posts: 8601
don't add code in the constructor. in showAlbumPage do
$template->setParameter('page_tpl', array(...));
then in album.tpl
{foreach from=$page_tpl item=tpl}...{/foreach}
or if your showAlbumPage gets a reference to $theme from the $template then you can do $theme['page_tpl'] = array(...); and reference $theme.page_tpl in your tpl.