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

Yet another sidebar question...

Discussion in 'Styling and Customization Questions' started by SgtSpike, Sep 22, 2011.

  1. SgtSpike

    SgtSpike Member

    I know sidebar questions get asked about a lot. But I have, what I think, is a new one.

    I have a text ad in ad_sidebar_top. But, if I am not logged in, the ad appears above the signup button. Is there any way I can have the ad appear below the signup button, but above the user avatar if the user is logged in?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    It already shows above the signup button in the default style.

    Have you customized the PAGE_CONTAINER? In the default template this code places that ad template before the signup button:

    Code:
    				<!-- sidebar -->
    				<aside>
    					<div class="sidebar">
    						<xen:hook name="page_container_sidebar">
    						<xen:include template="ad_sidebar_top" />
    						<xen:if is="!{$noVisitorPanel}"><xen:include template="sidebar_visitor_panel" /></xen:if>
    						{xen:raw $sidebar}
    						<xen:include template="ad_sidebar_bottom" />
    						</xen:hook>
    					</div>
    				</aside>
    
    edit - I misread your post. Well this is the relevant code. You can modify this code to your liking. This should do what you want:

    Code:
    				<!-- sidebar -->
    				<aside>
    					<div class="sidebar">
    						<xen:hook name="page_container_sidebar">
    						<xen:if is="{$visitor.user_id}"><xen:include template="ad_sidebar_top" /></xen:if>
    						<xen:if is="!{$noVisitorPanel}"><xen:include template="sidebar_visitor_panel" /></xen:if>
    						<xen:if is="!{$visitor.user_id}"><xen:include template="ad_sidebar_top" /></xen:if>
    						{xen:raw $sidebar}
    						<xen:include template="ad_sidebar_bottom" />
    						</xen:hook>
    					</div>
    				</aside>
    
     
  3. SgtSpike

    SgtSpike Member

    But the problem is, the visitor panel is also the avatar panel. So I want it below the signup button, but above the avatar panel, and both of those pieces seem to be contained in the visitor panel.

    Guess I just need to experiment with the visitor panel code. I'm nervous I'll screw something up though... but it can be reverted.
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    In case you didn't see it, I edited my post with code you can use.
     
  5. SgtSpike

    SgtSpike Member

    Ahhh, perfect, thanks!
     

Share This Page