profile tabs !

DroidHost

Well-known member
I want to add a new tab in the profile
and I am using this code for the template
HTML:
<li><a href="<li><a href="{$requestPaths.requestUri}#myroute">{xen:phrase Album}</a></li>">{xen:phrase Album}</a></li>
HTML:
<li id="album" class="profileContent" data-loadUrl="{xen:link members/myroute, $user}">
    {xen:phrase loading}...
    <noscript><a href="{xen:link members/myroute, $user}">{xen:phrase view}</a></noscript>
</li>
with these hooks:
member_view_tabs_heading
member_view_tabs_content

but the url that generate is not like what in other tabs
this is orginal generated url : http://localhost/xen/members/sndan.1/#recentActivity
but mine : http://localhost/xen/#album
 
Try this:
PHP:
<li><a href="{$requestPaths.requestUri}#album">{xen:phrase Album}</a></li>

PHP:
<li id="album" class="profileContent" data-loadUrl="{xen:link members/album, $user}">
{xen:phrase loading}...
    <noscript><a href="{xen:link members/album, $user}">{xen:phrase view}</a></noscript>
</li>
 
what is the different
You had <li> inside the link and # and id did not match

Do you have a function called 'actionAlbum()' in the XenForo_ControllerPublic_Member file.
That is what you are loading here. If the function does not exist it is not going to work.
 
Well you lost me.
Does your function return a XenForo_ViewPublic_Member_
Check out one of the add-ons that add a profile tab and compare your code...
 
@DroidHost
I have exactly the same problem.
the $requestPaths.requestUri is simply not there.... (although it is somewhere nested in the $hookParams)
could you please explain how you resend the template params to the template? (or whatever you did to fix it)
Luc
[EDIT]
I think I fixed it myself, changing:
$contents .= $template->create('mytemplate');
to
$contents .= $template->create('mytemplate', $template->getParams());
[/EDIT]
 
Top Bottom