Jump to content

Smarty Random Text Generator / Array inside .tpl


Recommended Posts

Some dude quoted this, but obviously, when I copy / paste this doesn't work. Might you have any ideas?

 

Do I have to create a smarty variable first? Than insert using php include?

 

{selectRandom(1, 2, 3, ...)}

 

source #1 http://stackoverflow.com/questions/2619216/smarty-display-a-random-sentence-from-array

source #2 http://www.smarty.net/forums/viewtopic.php?t=16348&view=previous&sid=d44618a0f23c1dcdff67072c4e263004

Link to comment
Share on other sites

Some dude quoted this, but obviously, when I copy / paste this doesn't work. Might you have any ideas?

Do I have to create a smarty variable first? Than insert using php include?

you won't need a php include... and if you do, think about using hooks rather than includes...

 

the code at the bottom of your second link looks fine to me if you're wanting to do this with images.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated