ds3422222 2014-06-17 14:06
浏览 9
已采纳

在类别博客布局中运行内容插件

I'm running Joomla 2.5 and I need to call a content plugin in a category blog layout. I have tried overriding the default blog layout with the following code so that the plugin would run:

$dispatcher = JDispatcher::getInstance();
JPluginHelper::importPlugin('content', 'name_of_plugin');
$dispatcher->trigger('onContentPrepare', array (& $item, & $item->params, 0));

However, the plugin is not loading and it gives me the following warning:

 Warning: Parameter 3 to name_of_plugin::onContentPrepare() expected to be a reference, value given in /var/www/libraries/joomla/event/event.php on line 71

Any help as to how I can integrate the plugin into the category blog layout would be very much appreciated.

  • 写回答

1条回答 默认 最新

  • dongliu1883 2014-06-19 07:40
    关注

    As it says, array (& $item, & $item->params, 0) is not a reference.

    Solution:

    $dispatcher = JDispatcher::getInstance();
    JPluginHelper::importPlugin('content', 'name_of_plugin');
    $call = array (& $item, & $item->params, 0);
    $dispatcher->trigger('onContentPrepare', $call);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 正弦信号发生器串并联电路电阻无法保持同步怎么办
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序