Forums | Mahara Community

Developers /
How to print out current theme in the template


Gjorgi M.'s profile picture
Posts: 16

03 April 2012, 6:58

Hi there,

I have a simple question.:

What variable can be used to print out the current theme name in the template?

I searched the code but I could not find out.

Or even bether...  Is there a documentation about this or some principle in the code structure that I can follow to figure out the variables that can be printed inside DWOO.

 

Thanks in advance.

anonymous profile picture
Account deleted
Posts: 808

03 April 2012, 18:13

As usual, no one's had time to document it, but it's easy enough to just read through the code.  Most variables used in the templates are assigned on specific pages only, right before the template is displayed. But if you look through the various $smarty->assign() calls inside the smarty function in htdocs/lib/web.php, you'll see the variables that should be available in all templates.  I don't think the current theme is set in that function, but you could make it available by adding something like this in smarty():

$smarty->assign('THEME', $THEME);

Then you could use {$THEME->displayname} in your template.

Gjorgi M.'s profile picture
Posts: 16

05 April 2012, 2:21

Thanks Ricahrd,

Very usefull tip.  I succesfully printed the name of the theme by adding suggested code in the htdocs/lib/web.php.

3 results