Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter
Support for Vanilla Forums Cloud product

In this Discussion

Follow Us


How do I add panels to the side bar?

djensen47djensen47 New
edited January 2011 in Questions
I searched in the forums for a while but was unable to finda clear answer.

How do I add my own custom panels to the side bar, panel or whatever it is called. I'd like a way to add some arbitrary text like the text widget on Wordpress.

I see that on this forum, there are some ads-like things "Services Available" box. I would like to do something similar. Do I modify the theme for that? Or is there a plugin?

Thanks.

Comments

  • edited January 2011
    Look for < div id=”Panel” > and then add this where you want:
    < div >< img src="http://www.google.com/images/srpr/nav_logo27.png" />< /div >

    That will insert a picture in your sidebar. Once you figure that out, you can add what you want.
  • TimTim Lord of Servers Vanilla Staff
  • I have this same question. I have the pockets plugin, but it's just a hole where you add html. How do i add another panel that matches my category panel, but contains a list of ......let's say....... Links to other websites?

  • LincolnLincoln Community Instigator Vanilla Staff

    So let's start with Vanilla terminology. The "Panel" is the name of a container asset in the master template (just like "Head", "Content", and "Foot") that, typically, is rendered as a sidebar. To add things to an asset, you can use the "AddAsset" or "AddModule" methods from any controller. Then you can then use a config setting like "Modules.Vanilla.Panel" to set the order you want things to render in.

    The Pockets plugin is really just a dynamic way of adding HTML strings to a container asset like the Panel.

    It sounds like what you want to do is make a new module (like "BookmarkModule") and include it in a simple plugin that just adds it in the right places.

    Sr Developer at Vanilla Forums [GitHub, Twitter]

    aeryDouglas_Thor
  • 422422 Developer MVP

    So @lincoln

    At present I use dashboard/message to add custom sidebar panels

    Should I use Pockets ?

    Reason I ask, is if we share/sell whatever a theme, then we would need an intuitive way of sharing custom sidebar panels ( messages ) etc.

    Is pockets the way to go ?

    422 Real Estate Australia , now open Check it out

  • @Lincoln what im trying to do, is add a box on the side bar which looks just like the Categories, tags, or Who's Online box, but has links to other websites in it. I have 5 other websites i would like to list there as links.

    I tired using the 'messages' feature and setting it to display on the sidebar, but it doesnt match my side bar boxes.

  • 422422 Developer MVP

    You can give it classes and ids using regular html

    422 Real Estate Australia , now open Check it out

  • AoleeAolee Hobbyist & Coder ✭✭
    edited December 2011

    play with this first

    <div id="LinkExchange" class="Box">
        <h4>Link Exchange</h4>
        <ul class="PanelInfo">
            <li><strong><a href="http://www.goodoldmemories.com/">Good Old Memories</a></strong>&nbsp;</li>
            <li><strong><a href="http://pinoyau.info/">Pinoy Australia Information Forum</a></strong>&nbsp;</li>
            <li><strong><a href="http://blog.zeratool.net/">Open Source Blog</a></strong>&nbsp;</li>                    
        </ul>
    </div>
    

    add the above code in your default.master.php after line

     <div id="Panel"><?php $this->RenderAsset('Panel'); ?>
    //place the above code here
    

    this is the easiest way i can think.

    422Douglas_Thormarthajane77
  • 422422 Developer MVP

    @aolee i prefer your method

    422 Real Estate Australia , now open Check it out

    Elysa
  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    Aolee

    Thanks very much for posting that.

    It is just the thing I've been looking for.

  • edited December 2011

    @Aolee

    I put that code into default.master.php but it did nothing at all.

    So i thought maybe it goes into the default.master.tpl file for my custom theme, but there it deformed the entire website. It almost worked in this location, but it appeared between the discussion list and the side bar. LOL

    EDIT: I should probably note that i was paying close attention to the div tags as not to overlap any code sections, but still no dice.

  • LincolnLincoln Community Instigator Vanilla Staff

    @422 Check out how approved plugins add sidebar content using modules.

    Sr Developer at Vanilla Forums [GitHub, Twitter]

  • 422422 Developer MVP

    Will do lincoln, thankyou

    422 Real Estate Australia , now open Check it out

    Elysa
  • AoleeAolee Hobbyist & Coder ✭✭

    Douglas_Thor said: @Aolee

    I put that code into default.master.php but it did nothing at all.

    So i thought maybe it goes into the default.master.tpl file for my custom theme, but there it deformed the entire website. It almost worked in this location, but it appeared between the discussion list and the side bar. LOL

    EDIT: I should probably note that i was paying close attention to the div tags as not to overlap any code sections, but still no dice.

    are you using a different theme? can i see your site?

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    Douglas_Thor

    I used the code just as Aolee posted in it my theme's defaultmaster.tpl and it behaved just as expected.

    You have to put the code AFTER the closing DIV tag of the div ID Panel.

  • @whu606 ok thank you. I'll give it another shot.

Sign In or Register to comment.