1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problems with a created Template Hook

Discussion in 'XenForo Development Discussions' started by MaikKR, Jul 30, 2011.

  1. MaikKR

    MaikKR New Member

    Hey everybody,
    I hope, that I am in the right subforum.

    I´ve written a Template Hook like Kiers Example.
    But, at first I will tell you what I would like to do:
    I want at every Profile a Number which shows if the profile are completed or not.
    Because of this I must know things like gender, age or something.
    I decided to take the templateHook account_personal_details_status.
    This works with a free text like "Test" or something else.
    But from the class (Account.php) I´ve found just the following return snippet:
                    return $this->_getWrapper(
                'account', 'personalDetails',
    That´s my problem.

    My hook Function is:
    public static function templatehook ($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
    In another Hook in the same file I´ve got a lot of details from $hookParams.
    But in this case, $hookparams contains just an empty array.
    The other parameter don´t seems to look better.

    Have anybode an Idea where I can get the right variables and which one are the best for my job?

    Thanks a lot.


  2. Jeremy P

    Jeremy P Well-Known Member

  3. MaikKR

    MaikKR New Member

    Hey Jeremy.
    Yes, this Code is the solution for my problem.
    Can you tell me how you get this?
    I would like to learn it for the next time.

  4. Jeremy P

    Jeremy P Well-Known Member

    Just from reading around on the forums back when I was having similar problems.
    That method always contains the template variables ($viewParams).
  5. MaikKR

    MaikKR New Member

    Hey Jeremy.
    Thank you.
    With this new way I hope to develop further things better :)
    Jeremy P likes this.

Share This Page