简体   繁体   English

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

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

I want to insert a custom field in the Article edit page in the administration area of Joomla 1.6.我想在 Joomla 1.6 的管理区域的文章编辑页面中插入一个自定义字段。 Please see screenshot.请看截图。

http://screencast.com/t/vtLEBdUK http://screencast.com/t/vtLEBdUK

I have tried to edit myjoomlasite/administrator/components/com_content/models/forms/article.xml .我试图编辑myjoomlasite/administrator/components/com_content/models/forms/article.xml

I can introduce a field in the article options fieldset, but not in the main edit area.我可以在文章选项字段集中引入一个字段,但不能在主编辑区域。

For insert a custom field in the Article edit page in the administration you need to change in two files要在管理的文章编辑页面中插入自定义字段,您需要在两个文件中进行更改

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

    add your field name like below code添加您的字段名称,如下面的代码

    <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 myjoomlasite/administrator/components/com_content/views/article/tmpl/edit.php

    add your label and input field添加您的 label 和输入字段

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

I wouldn't recommend modifying the core files to achieve what you want.我不建议修改核心文件来实现你想要的。

You could use one of Joomla's CCK (content construction kits) to create your content templates.您可以使用 Joomla 的 CCK(内容构建工具包)之一来创建您的内容模板。

Best free CCKs available for Joomla:适用于 Joomla 的最佳免费 CCK:

  1. Form2Content (my favorite) Form2Content (我最喜欢的)
  2. K2 (most popular, highly recommended) K2 (最受欢迎,强烈推荐)

You can find more in Joomla Extension Directory您可以在Joomla 扩展目录中找到更多信息

you can add custom fields to the article component (com_content), without the need to change core files in this link: http://docs.joomla.org/Adding_custom_fields_to_the_article_component您可以将自定义字段添加到文章组件(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