Arnox
Well-known member
I can't believe this has never been asked before, but anyway, here is my code so far.
	
	
	
		
The problem here is specifically this line:
	
	
	
		
If it is as above, it will always fire and display the image, no matter what the random number is. But if it is as below:
	
	
	
		
It will never fire and will just print out the variable.
What it SHOULD be doing is firing if the random number is 1 and just printing the variable otherwise. I've looked all over and I'm not sure what the hell the issue is here.
				
			
		HTML:
	
	<xf:set var="$number">
    {{ rand(1,3) }}
</xf:set>
<xf:if is="{$number} == 1">
    <a href="URL"><img src="image URL"></a>
<xf:else />
    <p>{$number}</p>
</xf:if>
	The problem here is specifically this line:
		Code:
	
	<xf:if is="{$number} == 1">
	If it is as above, it will always fire and display the image, no matter what the random number is. But if it is as below:
		Code:
	
	<xf:if is="{$number} == '1'">
	It will never fire and will just print out the variable.
What it SHOULD be doing is firing if the random number is 1 and just printing the variable otherwise. I've looked all over and I'm not sure what the hell the issue is here.