【问题标题】:Joomla's Hathor template pagination not working with custom backend componentJoomla 的 Hathor 模板分页不适用于自定义后端组件
【发布时间】:2012-12-26 14:45:09
【问题描述】:

编写了一个自定义后端组件,运行良好。仅允许一部分用户访问它,因此我从 Hathor 创建了一个修改过的模板,以消除我无法使用权​​限的所有内容。

发现分页不仅仅适用于 Hathor。我用 Bluestork 试了一下,效果很好。我还使用 Hathor(原始和未修改)和 Bluestork 测试了文章分页,并且都有效。也没有看到任何错误弹出。

什么可能导致我的组件中的分页无法与 Hathor 一起使用?

这是我用于分页的代码:

型号:

...other query stuff...
//Column ordering
    $orderCol = $this->getState('list.ordering');  //Ordering
    $orderDirn = $this->getState('list.direction'); //Direction

    if ($orderCol != '') {
        $query->order($db->getEscaped($orderCol.' '.$orderDirn));
    } //end column ordering

    return $query;
}

view.html.php

public function display($tpl = null)
{
    $this->items = $this->get('Items');
    $this->pagination = $this->get('Pagination'); //getting this automatically and being assigned to the view
    $this->state = $this->get('State');  //for published state drop down

default.php:

<input type="hidden" name="filter_order" value"<?php echo $listOrder; ?>" /> <!-- for sorting -->
<input type="hidden" name="filter_order_Dir" value"<?php echo $listDirn; ?>" /> <!-- for list direction -->

有人对可能发生的事情有任何想法吗?

【问题讨论】:

  • 当您说“分页不起作用”时,您实际看到的是什么? (例如,所有记录/没有记录/其他内容)另外,您问的是“分页”问题,但您列出的来自 default.php 的部分与过滤有关...
  • 感谢您的回复 - 抱歉花了这么长时间才回复。它只是在 URL 中显示了一个 # 并没有执行任何操作就转到了页面顶部。我最终包含了修复它的模式窗口的文件(见下文)。

标签: php joomla joomla2.5


【解决方案1】:

这可能发生在与表单“adminform”发生冲突时,您有两个或没有,并且您的默认 Joomla 导航不起作用(上面的某些按钮也不起作用)

【讨论】:

    【解决方案2】:

    我最后比较了 Chrome 中的一些管理模板输出,发现有大量代码没有被拉入。它似乎与模态窗口有关,所以我在 include 标题行下添加了这个我的模板:

    &lt;?php JHtml::_('behavior.modal'); ?&gt;

    我猜分页使用相同的 js 文件。不知道为什么它没有拉进来,也许是因为我限制了对这么多后端的访问,它认为它没有被使用?

    无论如何 - 已修复!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-08-25
      • 1970-01-01
      • 2015-08-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多