长话短说:我试着复制Joomla的Hello插件,旨在将"Hello“放在每一篇文章上,它安装得很好,但根本不起作用。
helloworld.php:
<?php
// no direct access
defined('_JEXEC') or die;
class plgContentHelloworld extends JPlugin
{
public function onContentAfterTitle($context, &$article, &$params, $limitstart)
{
return "<p>Hello World!</p>";
}
}
?>helloworld.xml:
<?xml version="1.0" encoding="utf-8"?>
<extension version="2.5" type="plugin" group="content">
<name>plg_content_helloworld</name>
<author>Brad Markle</author>
<creationDate>June 18th, 2012</creationDate>
<copyright>InMotion Hosting</copyright>
<license>GNU General Public License</license>
<authorEmail>bradm@inmotionhosting.com</authorEmail>
<authorUrl>http://www.inmotionhosting.com</authorUrl>
<version>1.0</version>
<description>Simple Hello World Plugin that prints "Hello World" at the beginning of every article.</description>
<files>
<filename plugin="helloworld">helloworld.php</filename>
<filename>index.html</filename>
</files>
</extension>我已经确保我启用了插件,并禁用了所有文章上的“显示简介文本”。
发布于 2015-06-11 22:09:31
检查这。将所有"a“替换为"A”的内容插件。这应该对你有很大的帮助(就像我过去那样)。
https://stackoverflow.com/questions/30791992
复制相似问题