Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How do I add panels to the side bar?

djensen47djensen47 New
edited January 2011 in Vanilla 2.0 - 2.8
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.
  • 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?

  • 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.

  • 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 ?

    There was an error rendering this rich post.

  • @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.

  • You can give it classes and ids using regular html

    There was an error rendering this rich post.

  • AoleeAolee ✭✭
    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.

  • @aolee i prefer your method

    There was an error rendering this rich post.

  • 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.

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

  • Will do lincoln, thankyou

    There was an error rendering this rich post.

  • 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?

  • 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.