How to insert custom field in Joomla 1.6 article editor?
I want to insert a custom f开发者_如何学Pythonield 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.
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 :
- Form2Content (my favorite)
- K2 (most popular, highly recommended)
You can find more in Joomla Extension Directory
For insert a custom field in the Article edit page in the administration you need to change in two files
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" />
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'); ?>
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
精彩评论