Welcome Guest, Not a member yet? Register   Sign In
Template Parser: Dont display var name if blank
#1

[eluser]Kriesi[/eluser]
Hey everyone, already did a search but couldnt find a solution to my problem:

the title basically says what I need:

I am using the template parser to display my views. since the data array that I pass to the view is populated by a database query and differs with each query I dont always get the same set of variables.

What I want to do is:

Write: {my_var} to the template

if $data[$my_var] has a value exchange {my_var} with this value. (normal behaviour)
if $data[$my_var] is not set just remove the {my_var} and dont display it...

any easy ways of pulling this of?

Thanks in advance
Kriesi


Messages In This Thread
Template Parser: Dont display var name if blank - by El Forum - 11-12-2009, 09:40 AM
Template Parser: Dont display var name if blank - by El Forum - 11-12-2009, 10:26 AM
Template Parser: Dont display var name if blank - by El Forum - 11-12-2009, 10:58 AM
Template Parser: Dont display var name if blank - by El Forum - 11-12-2009, 01:20 PM
Template Parser: Dont display var name if blank - by El Forum - 11-12-2009, 11:25 PM
Template Parser: Dont display var name if blank - by El Forum - 11-13-2009, 03:32 AM
Template Parser: Dont display var name if blank - by El Forum - 11-20-2009, 08:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB