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

Pagination Problem

Discussion in 'XenForo Development Discussions' started by ragtek, Apr 4, 2012.

  1. ragtek

    ragtek Guest

    I run into a problem with pagination, which i've never seen before:(


    template:
    Code:
     
    <xen:pagenav link="xxx"  linkdata="{$user}"  page="{$page}" perpage="{$perPage}"    total="{$totalAttachments}"  />
    
    controller is sending all necessary vars:
    PHP:
            $params = array(
                
    'xxx' => $xxx,
                
    'users' => $users,
                
    'user' => $user,
                
    'page' => $page,
                
    'perPage' => Ragtek_NAG_Config::PER_PAGE,
                
    'totalAttachments' => $this->_getModel()->countAttachments($conditions$fetchOptions),
            );
    It's working and showing the navigation, but the page links are false
    i'm getting index.php?xxx/&page=2
    instead of index.php?xxx/page=2


    I've checked the sourcecode and saw this
    Code:
    <div class="PageNav"
    data-page="1"
    data-range="2"
    data-start="2"
    data-end="2"
    data-last="3"
    data-sentinel="{{sentinel}}"
    data-baseurl="index.php?xxx/&amp;page=%7B%7Bsentinel%7D%7D">
     
    <span class="pageNavHeader">Page 1 of 3</span>
    IMO the data-baseurl should be
    Code:
    index.php?xxx/page-{{sentinel}}
    
    like it's for forums and all other things.....

    my route build link method:
    PHP:
        public function buildLink($originalPrefix$outputPrefix$action$extension$data, array &$extraParams)
        {
            if(isset(
    $data) && isset($data['user_id']))
            {
                
    $action XenForo_Link::getPageNumberAsAction($action$extraParams);
                return 
    XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix$action$extension$data'user_id''username');
            }
            return 
    XenForo_Link::buildBasicLink($outputPrefix$action$extension$data);
        }
    anybody have a idea why it's escaped?
     
  2. ragtek

    ragtek Guest

    ok, finally fixed:D
     
    oloman likes this.

Share This Page