Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Simple Code sample how to expand the left box?

edited August 2005 in Vanilla 1.0 Help
Hello! I am just looking for a simple code example to add some content like fixed links or some text / images to the left side - as a plugin Thanks!

Comments

  • you should really do it as an extension... there are some examples on the docs site that you could adapt pretty easily
  • MarkMark Vanilla Staff
    Check out: http://lussumo.com/docs/doku.php?id=vanilla:development:controlpanel
  • edited August 2005
    From the docs...
    
    // Put the ListName into a variable for the sake of brevity
    $ListName = $Context->GetDefinition("CoolLinks");
     
    // Add a link to google
    $Panel->AddListItem($ListName,
       $Context->GetDefinition("Google"),
       "http://www.google.com");
     
    // Add a link to Kottke.org (*tip-hat at Kottke for linking us*)
    $Panel->AddListItem($ListName,
       $Context->GetDefinition("Kottke"),
       "http://www.kottke.org",
       "ROCK!");
    
    makes :
    image

    Now - just change the links and names to whatever you so desire.

    M.
  • Thanks to you all guys. I couldn't remember the proper name ... that's why my search for the code flopped. Thanks a lot ... from an idiot. ;-)
  • MarkMark Vanilla Staff
    edited August 2005
    There are no idiots here.
  • LIAR! I'm insulted!
  • edited August 2005
    You're a douchebag. Not an idiot.

    Keep them straight, idiot!

    (this disclaimer is to let everyone know I'm kidding..)
  • Oke, the wiki explains search forms and stuff. How about adding a simple picture - if you wanna do it according to that Object Class something?!
  • MarkMark Vanilla Staff
    edited August 2005
    $MyPicture = "<img src=\"path/to/image.gif\" />"; $Panel->AddString($MyPicture);
  • edited August 2005
    Thanks a bundle Mark. I just want to avoid to hack vanilla ... just to make it work.
  • Questions: Is there any way to position lists / images in the control panel? And how do I change the code to include it on the index page and comments? Thanks.
  • Position with CSS, not quite sure what you mean...do you want it only on these pages or on them as well? M.
  • I think he means what order they go in. In which case i also think mark was considering adding this function like he did with positioning tabs.
  • minisweeper is correct - like the tabs I would like to order items in the panel.
  • Yeah, order on the panel would be cool
  • $Position="1" I am not sure if the position works on AddString, or just AddListItem. I have never actaully used AddString. Well, anyway, if the position is 1, then it is nearer the top, if it higher (5 for instance, then it will be positioned near the bottom). You might want someone else to confirm this though. I will test it, but I can't be sure.
  • edited August 2005
    This extension adds HTML to the panel. Please note that I DID NOT write this. I am using it, and it works, but I forgot who actually made it. Sorry, whoever it is. You know who you are, and all credit goes to you. <?php /* Extension Name: The Extension Name Extension Url: http://url_here Description: Adds HTML to the panel Version: 1.0 Author: Your Name Author Url: http://you_url_here */ if(in_array($Context->SelfUrl, array("account.php"))) { $Panel->AddList("htmlblock"); $HTMLBlockTitle = ""; $HTMLToDisplay = <<< ENDHTML <!-- Put HTML In Here --> ENDHTML; $Panel->AddListItem($HTMLBlockTitle,"</a>$HTMLToDisplay<a>","","",$Position="1",$Attributes=""); } ?> EDIT: For some reason, with HTML mode on, it actually creates an open link. I have turned it off html mode, so that it contiues to be useable.
This discussion has been closed.