如果您彻底检查了您提供的链接,您会发现一行“但是,只有当插件准备好允许覆盖时,您才能这样做。”
和
Joomla 提供了一种覆盖插件的机制,但并非所有插件都支持此功能。目前,Joomla 3.x 核心中唯一允许覆盖的插件是 Pagenavigation Content 插件,它在内容组件的文章视图中显示上一篇/下一篇文章链接。可能有来自第三方开发者的其他插件允许它,并且将来会覆盖更多的核心插件。
您的插件中是否有一个 tmpl 文件夹,如此处引用的那样“您会知道什么时候插件是可覆盖的,因为其中有一个 /tmpl/ 文件夹。”
你也用过JPluginHelper::getLayoutPath()。这些是在覆盖布局之前需要完成的要求。
在页面导航插件中检查此代码
// Output.
if ($row->prev || $row->next)
{
// Get the path for the layout file
$path = JPluginHelper::getLayoutPath('content', 'pagenavigation');
// Render the pagenav
ob_start();
include $path;
$row->pagination = ob_get_clean();
$row->paginationposition = $this->params->get('position', 1);
// This will default to the 1.5 and 1.6-1.7 behavior.
$row->paginationrelative = $this->params->get('relative', 0);
}
他们使用了 JPluginHelper::getLayoutPath();你必须使用
$path = JPluginHelper::getLayoutPath('search', 'my-plug-in');
您可以彻底检查页面导航插件以获得一个好主意。