Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Random background image? [RESOLVED]

byakkobyakko New
edited May 2016 in Vanilla 2.0 - 2.8

Hello! I'm trying to use this smarty tag to make a randomized background image on default.master.tpl but for some reason using the {capture} tag gives me a Something has gone wrong page.

{capture assign='num'}{1|rand:3}{/capture}
    <div id="header" style="background-image: url(header_bg{$num}.jpg)">

There are jQuery and php codes for this too but it seemed too extra to try to incorporate when smarty already had this.

Any thoughts why the {capture} tag isn't working? Thanks :)

Comments

Sign In or Register to comment.