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

profile tabs !

Discussion in 'XenForo Development Discussions' started by DroidHost, Jul 12, 2011.

  1. DroidHost

    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
     
  2. Syndol

    Syndol Guest

    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>
     
  3. DroidHost

    DroidHost Well-Known Member

    no it doesn't wok
    what is the different
     
  4. Syndol

    Syndol Guest

    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.
     
  5. DroidHost

    DroidHost Well-Known Member

    the function is there and if I make the links manually it works but that is not enough
     
  6. Syndol

    Syndol Guest

    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...
     
  7. DroidHost

    DroidHost Well-Known Member

  8. DroidHost

    DroidHost Well-Known Member

    solved
    I forget to resent the template params to my templates
     
  9. Luciano

    Luciano Member

    @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]
     

Share This Page