Categories > TinyButStrong general >

Passing a variable to max variable

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Maz
Date: 2005-08-21
Time: 17:38

Passing a variable to max variable

I have:

[news.post;max=150]</p>

However, I'd like to replace the 150 value with a variable which I have populated on the calling PHP page.

$charlimit = $config['news_charlimit'];

I have tried max=$charlimit and max=[var.charlimit] and now I've run out of ideas.

Any help greatly appreciated.
By: Skrol29
Date: 2005-08-21
Time: 19:59

Re: Passing a variable to max variable

Hello,

The '...' that is put at the end is coded hard in TBS.
But I can make it a TBS property for the next version that should be released very soon.
By: Maz
Date: 2005-08-21
Time: 20:30

Re: Passing a variable to max variable

Hi, Skrol.

I think you may have misunderstood me, or I didn't explain very well.

Instead of using 150 s the max, I want to use $charlimit to limit the number of characters being displayed before the ...
By: Skrol29
Date: 2005-08-21
Time: 21:08

Re: Passing a variable to max variable

ha, ok,

They are several ways to force the merge of a variable before the Show() method.

You can use [var.charlimit] and $TBS->MergeSpecial('var').
But sometimes all the Var fiels of the templates haven't got they corresponding global variables ready yet.

You can also use [charlimit] and $TBS->MergeField('charlimit',$charlimit)

Or [onload;ifempty '[var.charlimit]']

By: Maz
Date: 2005-08-21
Time: 23:54

Re: Passing a variable to max variable

You can also use [charlimit] and $TBS->MergeField('charlimit',$charlimit)

Thanks, Skrol. That was exactly what I needed. Thanks again.