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.

[Vanilla 2 RC2] Ideas for attaching content after the Userinfo Box?

oliverraduneroliverraduner ✭✭
edited June 2010 in Vanilla 2.0 - 2.8
I am just working on a new Plugin and I want to attach another Box panel after the "About" on the left side in a User's Profile.
That part (the About) is being created from the userinfo.php-View. Unfortunately, there is only an Event inside the <div></div> to attach custom output.

My workaround for the moment is, that I copy the View-file "userinfo.php" to my Theme folder and add the following code in the very bottom:
<?php
}
$this->FireEvent('AfterShowAbout');
This does work like a charm - but makes my Plugin too static to distribute at a later stage.

Have you guys any proposals how I could attach my content without having to edit the userinfo-View? Is there probably a different, better approach?

Thank you,
Oliver

Comments

  • TimTim Vanilla Staff
    We can just add an event for you down there. It will be in our next release.

    Vanilla Forums COO [GitHub, Twitter, About.me]

  • TimTim Vanilla Staff
    edited June 2010
    Actually I just checked into this and there is another way you can do this. The UserInfo module should probably not have an event added down there as it is meant to be used as a standalone chunk. What you can do instead is use the AddAsset method on the ProfileController. You can hook into the _before or _after event of the ProfileController method(s) you care about, and just call
    $Sender->AddAsset("Panel",[CONTENTS],[NAME]);
    Where [CONTENTS] = the data/html you want to come after the About box, and [NAME] is a name for the new box you're creating.

    Tell me if that works.

    Vanilla Forums COO [GitHub, Twitter, About.me]

  • Tell me if that works.
    ...LIKE A CHARM!!

    Thank you very much for this great tipp, @Tim!
  • Btw. @Tim: the result ;-)
Sign In or Register to comment.