简体   繁体   中英

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. Please see screenshot.

http://screencast.com/t/vtLEBdUK

I have tried to edit 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

    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

    add your label and input field

    <?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.

Best free CCKs available for Joomla:

  1. Form2Content (my favorite)
  2. K2 (most popular, highly recommended)

You can find more in Joomla Extension Directory

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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