Joomla 3.0 Hello World 程序不会显示
Joomla 3.0 Hello World Program Will Not Display
长话短说:我尝试为 Joomla 复制一个 Hello World 插件,旨在将 "Hello World" 放在每篇文章上,它安装正确,但根本不起作用。
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>
我已经确保在所有文章上启用了插件并禁用了 "Show Intro Text"。
勾选this。将所有 "A" 替换为 "a" 的内容插件。
这应该对你有很大帮助(就像我过去一样)。
长话短说:我尝试为 Joomla 复制一个 Hello World 插件,旨在将 "Hello World" 放在每篇文章上,它安装正确,但根本不起作用。
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>
我已经确保在所有文章上启用了插件并禁用了 "Show Intro Text"。
勾选this。将所有 "A" 替换为 "a" 的内容插件。 这应该对你有很大帮助(就像我过去一样)。