XF 1.5 Randomise UIX Welcome Block Text

Noodl

Member
Edit: Solved myself using:
{xen:raw '$banners.{xen:calc '({$serverTime} % 61) + 1'}'}

Hi guys,

I use the #Rekt XF theme, which uses the UIX welcome block, which has a headline, and a subheading text section on it.

What I wanted to do was randomise the subheading to create a sort of "loading line" type thing, which are obviously just chosen from a file/array.
I found the template:

Code:
<div class="uix_welcomeBlock_wrap">
    <div class="uix_welcomeBlock_content">
 
        <a href="#" class="close"></a>
 
        <xen:if hascontent="true">
        <h3 class="uix_welcomeBlockHeader">
            <xen:contentcheck>
            <xen:if is="{$uix_welcomeBlockIcon_class}"><i class="uix_icon {$uix_welcomeBlockIcon_class}"></i></xen:if>
            <xen:if is="{$uix_welcomeBlockHeader_text}"><span>{xen:raw $uix_welcomeBlockHeader_text}</span></xen:if>
            </xen:contentcheck>
        </h3>
        </xen:if>
     
        <xen:if is="{$uix_welcomeBlockMessage_text}"><p class="uix_welcomeBlockMessage">{xen:raw $uix_welcomeBlockMessage_text}</p></xen:if>
        <xen:if is="{$uix_welcomeBlockButton_url}"><a href="{$uix_welcomeBlockButton_url}" class="callToAction"><span>{$uix_welcomeBlockButton_text}</span></a></xen:if>

    </div>
</div>

The {xen:raw $uix_welcomeBlockMessage_text} in the <p> tag draws from an options field, but as far as I'm aware I can't just whack PHP in there.

However I don't actually know how Xen tag syntax works, and if PHP is usable etc, so I figure best to just post here and ask for a snippet that randomly chooses an a number to index into an array of strings to display as the welcome message.

Thanks!
 
Last edited:
Back
Top Bottom