SOLVED: Using a user-defined variable to control "maxSize" of navigation thumbnails?

jnshk

Joined: 2004-01-03
Posts: 16
Posted: Wed, 2006-10-18 00:46

I'm trying to put the finishing touches on a theme that I'm working on, and I've come across something that I can't figure out.

Is there a way to call a user-defined variable as the value for maxSize on a g->image tag?

I've put together a .tpl file that creates navigation thumbnails, and I'd like to allow users to define the max size of the thumbnails through the themes settings page. I know that I can create and set a user-defined variable in the theme.inc, but I'm not sure how (or if it is even possible) to call it in the image tag.

SOLUTION:

Add a new setting input to your theme.inc with whatever variable name you desire. I chose "ThumbSize".

In the tpl file which has your thumbnails, add the following code before the thumbnails are called:
{assign var="ThumbSize" value=$theme.params.ThumbSize}

Where the thumbnails are called in the tpl, the code will look something like:
{g->image item=$peer image=$peer.thumbnail maxSize=$ThumbSize}