XF 1.3 Conditional statement in "CSS" template.

Mian Shahid

Well-known member
Hi, Can we use conditional statement in "CSS" templates? for example:

PHP:
<xen:if is="{$visitor.user_id}">
.conversation_view .messageList
{
   border: 1px solid @primaryLighterStill;
   border-left: none;
   border-bottom: none;
   padding-right: 10px;
   border-top-right-radius: 10px;

<xen:elseif is="{$visitor.user_id}">
.conversation_view .messageList
{
   border: 1px solid @primaryLighterStill;
   border-left: none;
   border-bottom: none;
   padding-right: 10px;
   border-top-right-radius: 10px;

<xen:elseif is="{$visitor.user_id}">
.conversation_view .messageList
{
   border: 1px solid @primaryLighterStill;
   border-left: none;
   border-bottom: none;
   padding-right: 10px;
   border-top-right-radius: 10px;
<xen:else />
.conversation_view .messageList
{
   border: 1px solid @primaryLighterStill;
   border-left: none;
   border-bottom: none;
   padding-right: 10px;
   border-top-right-radius: 10px;
</xen:if>

If yes, kindly advise correct way to put these together.

Thank you in advance. :)
 
CSS templates don't support conditional statements.

I don't think so.

Hi, Can we use conditional statement in "CSS" templates? for example:

PHP:
<xen:if is="{$visitor.user_id}">
.conversation_view .messageList
{
   border: 1px solid @primaryLighterStill;
   border-left: none;
   border-bottom: none;
   padding-right: 10px;
   border-top-right-radius: 10px;

<xen:elseif is="{$visitor.user_id}">
.conversation_view .messageList
{
   border: 1px solid @primaryLighterStill;
   border-left: none;
   border-bottom: none;
   padding-right: 10px;
   border-top-right-radius: 10px;

<xen:elseif is="{$visitor.user_id}">
.conversation_view .messageList
{
   border: 1px solid @primaryLighterStill;
   border-left: none;
   border-bottom: none;
   padding-right: 10px;
   border-top-right-radius: 10px;
<xen:else />
.conversation_view .messageList
{
   border: 1px solid @primaryLighterStill;
   border-left: none;
   border-bottom: none;
   padding-right: 10px;
   border-top-right-radius: 10px;
</xen:if>

If yes, kindly advise correct way to put these together.

Thank you in advance. :)

I believe you can, why not try it yourself.
 
Top Bottom