1

I create a custom field which gets related people,subjects of an article when I edit it.I want to pass the category id of this article , but I can't figure out how to do it. Below is my code: In article.xml

<fields name="idn_tags">
        <field name="idn_tags_people" type="IdnTagsPeopleCheckboxes" />
        <field name="idn_tags_subject" type="IdnTagsSubjectCheckboxes" />
</fields>

In edit.php

<?php echo $this->form->getInput('idn_tags_people','idn_tags'); ?>
<?php echo $this->form->getInput('idn_tags_subject','idn_tags'); ?>

In every class IdnTagsPeopleCheckboxes and IdnTagsSubjectCheckboxes I want to pass category id of current article to get only people, subjects of this category which article maybe tagged.

  • it look like your are make a joomla module? am i right?? and which version of joomla you are using?? – jogesh_pi Dec 03 '12 at 04:14
  • I am newbie, I just wanna edit comp_content in administrator. I'm using joomla 2.5.7. I think the problem is how to override method getInput to pass the parameter, but i can't :| – hoanhung191290 Dec 03 '12 at 04:20

2 Answers2

1

Joomla has already covered adding custom fields to the article component Read this. If you have any issues let me know. Read this as well.

Community
  • 1
  • 1
Techie
  • 44,706
  • 42
  • 157
  • 243
0

Ok! Just do this:

<?php $this->form->setValue('idn_tags_people','idn_tags', $[Your Value]); ?>
<?php echo $this->form->getInput('idn_tags_people','idn_tags'); ?>
Pham Quang
  • 129
  • 1
  • 8