Not signed in (Sign In)

Categories

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorscrawler
    • CommentTimeFeb 1st 2008
     # 1
    Stupid lazy question, sorry.

    I just started using the shiny new "BlogThis" extension (works great, btw). On my blog page, there is nothing -- zero -- nada -- in the sidebar except the really nice background image. I'd like to stick some nuggets over there to keep things looking balanced, but I don't want the nuggets anywhere else.

    How can I accomplish this?

    Thanks.
    • CommentAuthortimfire
    • CommentTimeFeb 1st 2008 edited
     # 2
    I don't... *think* that's possible without hacking the Nuggets code.

    But you can use the following code to insert content into the Panel. Just pop it in a file called "default.php", place the file in a folder called "CustomPanelObjects" (or whatever), place that folder in the extensions directory, and enable it like any other extension.

    <?php
    /*
    Extension Name: Custom Panel Objects
    Extension Url: n/a
    Description: n/a
    Version: 0.1
    Author: Timothy Walters Kleinert
    Author Url: n/a
    */

    // I'm assuming BlogThis uses "extension.php?PostBackAction=BlogThis".
    // If I'm wrong, just change the SelfUrl & PostBackAction to the appropriate values.
    if ($Context->SelfUrl = 'extension.php' && ForceIncomingString('PostBackAction', '') == 'BlogThis') {

    // Here's where you enter the content you want to render.
    $EchoContent1 = '';

    // This changes the order the object is rendered in relation to other Panel objects.
    $ObjectPosition1 = 0;

    $CustomObject1 = $Context->ObjectFactory->NewContextObject($Context, 'CustomPanelContent ', $EchoContent1);
    $Page->AddRenderControl($CustomObject2, $Configuration['CONTROL_POSITION_PANEL'] + $ObjectPosition1);

    // You can create more than one object by replicating the the above code.
    // Just be sure to always give the variables different names.
    // Note, if all your objects are going to be in a line, you can just string them together in one $EchoContent.
    // You can use the code below if you remove the comment markers /* */
    /*
    $EchoContent2 = '';
    $ObjectPosition2 = 0;
    $CustomObject2 = $Context->ObjectFactory->NewContextObject($Context, 'CustomPanelContent ', $EchoContent2);
    $Page->AddRenderControl($CustomObject2, $Configuration['CONTROL_POSITION_PANEL'] + $ObjectPosition2);

    $EchoContent3 = '';
    $ObjectPosition3 = 0;
    $CustomObject3 = $Context->ObjectFactory->NewContextObject($Context, 'CustomPanelContent ', $EchoContent3);
    $Page->AddRenderControl($CustomObject3, $Configuration['CONTROL_POSITION_PANEL'] + $ObjectPosition3);
    */
    }

    class CustomPanelContent extends Control {
    var $Context;
    var $EchoContent;

    function CustomPanelContent(&$Context, $EchoContent) {
    $this->Context = $Context;
    $this->$Content = $EchoContent;
    }

    function Render() {
    echo $this->EchoContent;
    }
    }
    ?>
Add your comments
    Username Password
  • Format comments as