|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
cyber_wolf Smarty n00b
Joined: 15 Feb 2004 Posts: 2
|
Posted: Sun Feb 15, 2004 10:28 am Post subject: Images in popup plugin |
|
|
How can I display an image in a popup if the image url is in a variable.
popup text="<img src='image.gif'>" works but popup text="<img src=$variable>" doesn't. I've tried src="$variable" src='variable' which give errors.
I've also tried background=$variable, fgbackground=$variable, bgbackground=$variable and all give me errors as long as the image url is in a variable.
Thanks,
cyber_wolf |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Sun Feb 15, 2004 4:03 pm Post subject: |
|
|
you have to escape quotes inside quotes with a \, just like in php:
{popup text="<img src=\"$variable>\""} |
|
Back to top |
|
cyber_wolf Smarty n00b
Joined: 15 Feb 2004 Posts: 2
|
Posted: Sun Feb 15, 2004 4:50 pm Post subject: |
|
|
messju wrote: | you have to escape quotes inside quotes with a \, just like in php:
{popup text="<img src=\"$variable>\""} |
Thanks messju.
It seems my problem wasn't in the formatting of the code, but that the popup plugin doesn't like arrays. The vaiable I was using was $product[product].image and the generated source code was Array.image.
I fixed it by assigning $product[product].image to another variable and using the new variable as the image src which worked.
Thanks,
cyber_wolf |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|