3

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.

TylerH
  • 20,799
  • 66
  • 75
  • 101
Anna
  • 31
  • 1
  • 3

3 Answers3

3

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'); ?>
    
talha2k
  • 24,937
  • 4
  • 62
  • 81
Karthick Terror
  • 801
  • 2
  • 8
  • 11
  • You'll also need to add a reference to the new fields in the ``/components/com_content/models/article.php`` file around line 84. – ams Aug 22 '11 at 00:42
  • This Answer has little shortcoming like the new custom field is added in the new article post-page but its not visible in the edit/update post page – uzair May 20 '13 at 18:41
  • +1 Thanks Mate! I've been scratching my head from past 2 days! – talha2k Jul 12 '13 at 07:43
3

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

Ahmad Alfy
  • 13,107
  • 6
  • 65
  • 99
0

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

mrash
  • 883
  • 7
  • 18