• 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

#1
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:
Code:
                return $this->_getWrapper(
            'account', 'personalDetails',
            $this->responseView(
                'XenForo_ViewPublic_Account_PersonalDetails',
                'account_personal_details',
                $viewParams
That´s my problem.

My hook Function is:
Code:
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.

Faithfully

Maik
 
#3
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.

Faithfully
 

Jeremy P

Well-known member
#4
Just from reading around on the forums back when I was having similar problems.
That method always contains the template variables ($viewParams).