I am looking for a way to show some content 50% of the time, and some other content the other 50% of the time.
So basically what I want to do it to is:
- declare a global variable at the top of the globalTemplate
- assign that global variable a random value, could be 0 or 1, or from 1 to 10 or something, just some value that I can check against later
- wherever I want the A/B testing to be done in the child templates I would then check against the global variable to see if I should show A or B
I have tried with regular PHP code, but variable scopes are not global, so that doesn't work.
Any good ideas as to how to do this in "IP.Board code"?
I can get it done in JS pretty easily, but then I would have to output all the A/B content with JS and that would be a nightmare.