繁体   English   中英

如何在 Joomla 1.6 文章编辑器中插入自定义字段?

[英]How to insert custom field in Joomla 1.6 article editor?

我想在 Joomla 1.6 的管理区域的文章编辑页面中插入一个自定义字段。 请看截图。

http://screencast.com/t/vtLEBdUK

我试图编辑myjoomlasite/administrator/components/com_content/models/forms/article.xml

我可以在文章选项字段集中引入一个字段,但不能在主编辑区域。

要在管理的文章编辑页面中插入自定义字段,您需要在两个文件中进行更改

  1. myjoomlasite/administrator/components/com_content/models/forms/article.xml

    添加您的字段名称,如下面的代码

    <field name="name" type="text" label="JGLOBAL_NAME" description="JFIELD_NAME_DESC" class="inputbox" size="30" required="true" />
  2. myjoomlasite/administrator/components/com_content/views/article/tmpl/edit.php

    添加您的 label 和输入字段

    <?php echo $this->form->getLabel('name'); ?> <?php echo $this->form->getInput('name'); ?>

我不建议修改核心文件来实现你想要的。

您可以使用 Joomla 的 CCK(内容构建工具包)之一来创建您的内容模板。

适用于 Joomla 的最佳免费 CCK:

  1. Form2Content (我最喜欢的)
  2. K2 (最受欢迎,强烈推荐)

您可以在Joomla 扩展目录中找到更多信息

您可以将自定义字段添加到文章组件(com_content),而无需更改此链接中的核心文件: http://docs.joomla.org/Adding_custom_fields_to_the_article_component

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM