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.

Help with PreBodyRender

edited March 2007 in Vanilla 1.0 Help
I have written an extension that displays a small palette with a number of navigation icons roughly like this...

image image image image image imageimage

It seems to work ok but the code gets written too early on the page, even before the <html> tag.
It does not cause any problems except for a slight cosmetic glitch on the settings page.

Of course, to do it right, it needs to be written inside the <body> tag so I can position it using CSS at the top-left of the page.

I've investigated $this->CallDelegate('PreBodyRender'); but I can't seem to make it work, any clues?

Posted: Thursday, 29 March 2007 at 9:16AM


  • edited March 2007
    it should look likefunction DisplayNavigationicons(&$Menu){ echo "... } $Context->AddToDelegate($Menu, 'PreBodyRender', 'DisplayNavigationicons');
  • Looked promising but I get this...

    Warning: array_key_exists(): The first argument should be either a string or an integer in /forum/library/Framework/Framework.Class.Context.php on line 37 Warning: Illegal offset type in /forum/library/Framework/Framework.Class.Context.php on line 37 Warning: Illegal offset type in /forum/library/Framework/Framework.Class.Context.php on line 38 Warning: array_key_exists(): The second argument should be either an array or an object in /forum/library/Framework/Framework.Class.Context.php on line 38 Warning: Illegal offset type in/forum/library/Framework/Framework.Class.Context.php on line 38 Warning: Illegal offset type in /forum/library/Framework/Framework.Class.Context.php on line 39

    Posted: Thursday, 29 March 2007 at 10:19AM

  • whats ur complete code
    what Dinoboff said should work just fine
  • Of course, you could always add it as a new render control, like how the Lussumo Banner does.
  • Ripper Wallphone, just what I needed!

    Thanks Dinoboff and MySchizoBuddy, for your input too, each tip teaches me something.

    Sometimes the answer is looking you in the face but you are not looking back with open eyes.

    Posted: Thursday, 29 March 2007 at 12:42PM

  • edited March 2007
    Take the Dollar sign out.
    $Context->AddToDelegate(Menu, 'PreBodyRender', 'DisplayNavigationicons');
    it worked for me

    plus like Wallphone said, u can use controls as well. or u can use my Nuggets thingy :P
  • yep, it should be $Context->AddToDelegate('Menu', 'PreBodyRender', 'DisplayNavigationicons');
  • (Can't anyone create a Snippet extension for Vanilla code ;-)
  • Thanks guys, I used Mark's Lussumo Banner method as suggested by WallPhone.

    It wasn't so hard once I remembered to declare global variables, it took me back to HyperCard days!

    Any HyperCard veterans out there?

    Anyway, check it out in action...


    Is there a use for it out there? If so I'll package it up and upload it.

    I'm off to test it on Exploder, if you don't hear from me soon I've done myself in. pic

    Posted: Thursday, 29 March 2007 at 1:22PM

  • edited March 2007
    Good work Wanderer.

    Dinoboff u mean something like this

    its very to make in Textmate. just copy paste. I will however need all the code templates. that will be the time consuming part
  • edited March 2007
    I used HyperCard many years ago and many other hypertext tools including one I helped someone write call DesktopAdvisor.
  • I was thinking to a snippet extension for the forum.
  • edited March 2007
    So the PreBodyRender is below the Header div, and PreHeaderRender is above the Header div. There is no control or delegate that is actually INSIDE the Header div. only way is to use CSS hell to get it to look like that its inside the Header Div is the only area where u cannot get into.
This discussion has been closed.