• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

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

Allan

Well-known member
#1
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 ?
 

Allan

Well-known member
#8
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.png
 

James

Well-known member
#9

Jake B.

Well-known member
#11
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
 

James

Well-known member
#13
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!
 

Lawrence

Well-known member
#14
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.