Page 1 of 1

Source image from theme in index.tpl

Posted: Thu Mar 30, 2006 5:35 am
by DarKRaveR
Hi all,

Within the index.tpl in a theme, I want to make use of an image, which comes along the theme. The question now is, which variable gives me the right path to the template directory?

{$serendipityBaseURL} gives the baseurl, is there a similiar variable for the template directory?

Any documentation on all functions/variables that can be used within the smarty templates?

Posted: Thu Mar 30, 2006 5:42 am
by DarKRaveR
Is {serendipity_getFile file=""} really the only way, of doing this? no direkt variable giving the baseurl to the template directory ?

Posted: Thu Mar 30, 2006 12:31 pm
by garvinhicking
Yes, this function is the only way. This is because the templates can be nested inside the directory, depending on how people put it.

A theme can not only be in /serendipity/themes/mytheme, but other people could have it in /serendipity/themes/more_themes/mytheme/.

This function also ensures that if a specific file is not found in the current template, it falls back to the default template. Which is a very good thing to have, and many users appreciate about serendipity.

If you just use the template for your own, you can use "{$serendipityBaseURL}templates/mytheme/img/bla.gif" of course.

Regards,
Garvin

Posted: Thu Mar 30, 2006 6:14 pm
by DarKRaveR
Okay, thanx, I'd rather keep it generic ... and yes it makes sense havin a function then (concerning the nesting) - I simply forgot about that ...