• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Balance sidebar length for Guest and Members with Twitter

mrGTB

Well-known member
There are some blocks guests tend not to see that member do in the sidebar, and it can make it seem very short for visitors in comparson. That can be changed using a conditional and the "Latest Tweets" block if you use twitter. You can change how many tweets are shown to guests different from logged in members. This can help you gain some extra length back used in the sidebar for guests viewing because they don't see certain other blocks like members do.

In short, it's a handy flexible block you can use to help better balance out the sidebar length for both members and guest viewing by changing one simple (RRP) number setting.

Example blow using the "ad template" called: ad_sidebar_bottom
Best having this loading last in the sidebar.

Take note of the code in red with rpp4 (4 tweets shown to guests) and rpp3 (3 tweets shown to members).

<xen:if is="!{$visitor.user_id}">
<div class="section">
<div class="secondaryContent">
<h3>Latest Tweets</h3>
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 4,
interval: 30000,
width: 'auto',
height: 300,
theme: {
shell: {
background: '#d7edfc',
color: '#141414'
},
tweets: {
background: '#f0f7fc',
color: '#141414',
links: '#65a6d1'
}
},
features: {
scrollbar: false,
loop: false,
live: false,
behavior: 'all'
}
}).render().setUser('mrgtbtweeting').start();
</script>
</div>
</div>
<xen:else />
<div class="section">
<div class="secondaryContent">
<h3>Latest Tweets</h3>
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 3,
interval: 30000,
width: 'auto',
height: 300,
theme: {
shell: {
background: '#d7edfc',
color: '#141414'
},
tweets: {
background: '#f0f7fc',
color: '#141414',
links: '#65a6d1'
}
},
features: {
scrollbar: false,
loop: false,
live: false,
behavior: 'all'
}
}).render().setUser('mrgtbtweeting').start();
</script>
</div>
</div>
</xen:if>

Here is is again in code format this time :

Code:
<xen:if is="!{$visitor.user_id}">
<div class="section">
    <div class="secondaryContent">
        <h3>Latest Tweets</h3>
        <script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'profile',
  rpp: 4,
  interval: 30000,
  width: 'auto',
  height: 300,
  theme: {
    shell: {
      background: '#d7edfc',
      color: '#141414'
    },
    tweets: {
      background: '#f0f7fc',
      color: '#141414',
      links: '#65a6d1'
    }
  },
  features: {
    scrollbar: false,
    loop: false,
    live: false,
    behavior: 'all'
  }
}).render().setUser('mrgtbtweeting').start();
</script>
        </div>
    </div>
<xen:else />
<div class="section">
    <div class="secondaryContent">
        <h3>Latest Tweets</h3>
        <script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'profile',
  rpp: 3,
  interval: 30000,
  width: 'auto',
  height: 300,
  theme: {
    shell: {
      background: '#d7edfc',
      color: '#141414'
    },
    tweets: {
      background: '#f0f7fc',
      color: '#141414',
      links: '#65a6d1'
    }
  },
  features: {
    scrollbar: false,
    loop: false,
    live: false,
    behavior: 'all'
  }
}).render().setUser('mrgtbtweeting').start();
</script>
        </div>
    </div>
</xen:if>

guest-view.webp

member-view.webp
 
Oh, before I forget? If you want to add the Follow Me twitter button in one of the ad_templates, I use "ad_sidebar_top". Use this code below changing the @mrgtbtweeting to your account held in twitter.

Code:
<div class="section">
    <div class="secondaryContent">
        <h3>Follow Us</h3>
        <a href="https://twitter.com/mrgtbtweeting" class="twitter-follow-button" data-show-count="false">Follow @mrgtbtweeting</a>
<script src="//platform.twitter.com/widgets.js" type="text/javascript"></script>
    </div>
</div>
 
Top Bottom