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

XF 1.3 Creating a sidebar widget with same appearance as other widgets

Discussion in 'Styling and Customization Questions' started by Neal, Jul 16, 2014.

  1. Neal

    Neal Well-Known Member

    I want to add a new sidebar widget that replicates the look of the other sidebar widgets. Could someone give me some basic guidance on how to do this please?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Copy the basic structure from the sidebar_online_users template.

    Code:
    <div class="section myClass">
    <div class="secondaryContent">
    <h3>{xen:phrase my_block}</h3>
    Content
    </div>
    </div>
     
    Neal likes this.
  3. Neal

    Neal Well-Known Member

    Thanks Brogan but do I create a new template and paste this in, etc?
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    You can either use one of the ad_sidebar_* templates or create your own and include it.
     
  5. Neal

    Neal Well-Known Member

    I've managed to add content to the ad_sidebar_bottom but i'm just confused creating a widget from scratch. When I created a copy of the ad_sidebar_bottom template and renamed it I somehow need to get it to appear on the sidebar....

    Sorry to be a pest. Just wish this option was easier for someone who doesn't code.
     
  6. Neal

    Neal Well-Known Member

    Basically i've created a widget for Twitter that works using the ad_sidebar_bottom template, I just want a widget below that one now for Facebook.
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    You just add your code between the divs as shown above - where it states "Content".
     
  8. Neal

    Neal Well-Known Member

    This is what I have in my ad_sidebar_bottom template which works and i've created my own phrase. If I create a second template named slightly differently but using the same code below except changing Twitter to Facebook and the phrase, that block doesn't show on the sidebar.

    Code:
    <xen:hook name="ad_sidebar_bottom" />
    
    <div class="section myClass">
    <div class="secondaryContent">
    <h3>{xen:phrase my_block_twitter}</h3>
    
    TWITTER WIDGET CODE HERE
    
    
     
  9. Neal

    Neal Well-Known Member

    Ok I just copy the facebook code underneath the twitter one and it works :X3:

    Thanks for the help :)
     

Share This Page