How use several times <xen:sidebar> ... </xen:sidebar> in same template ?

Allan

Well-known member
Hello,

I would like use <xen:sidebar> ... </xen:sidebar> in the same template.

Example:
<xen:sidebar> Content 1 </xen:sidebar>
<xen:sidebar> Content 2 </xen:sidebar>
<xen:sidebar> Content 3 </xen:sidebar>

One variable is displayed instead of 3

I have not found a solution to run all variables together :(

An idea ?
 
No, it doesn't really make any sense. If it's in the same template why not just do:

Code:
<xen:sidebar>
<xen:if is="{$conditionforsidebarone}">
  content
</xen:if>

<xen:if is="{$conditionforsidebartwo}">
  more content?
</xen:if>
</xen:sidebar>
Yes but if you disable both, it will remain just <xen:sidebar> </xen:sidebar>, and my problem is if there are only <xen:sidebar> </xen:sidebar>, and this creates a blank space.

Example:

Screenshot_11.webp
 
contentcheck should probably be inside xen:sidebar, and if you hardcode a div in without it being wrapped in an if it'll always display
 
You can have HTML between the if and the content check but I don't believe you can next the content check inside another xenforo template tag (like your sidebar). You may need to readdress your template structure or find another way of hiding it. Nothing springs to mind at present!
 
Hello,

I would like use <xen:sidebar> ... </xen:sidebar> in the same template.

Example:
<xen:sidebar> Content 1 </xen:sidebar>
<xen:sidebar> Content 2 </xen:sidebar>
<xen:sidebar> Content 3 </xen:sidebar>

One variable is displayed instead of 3

I have not found a solution to run all variables together :(

An idea ?

If I understand what you are trying to do, I don't think you can. You may have to skip the sidebar tag completely and add in the actual HTML:
<aside>
<div class="sidebar" id ="sidebar_1">
<---- blocks here------>
</div>
</aside>

I'd give them each their own unique id so you can target each separately for styling or displaying, if needed. You would also be able to use a separate content check for each one this way.
 
Back
Top Bottom