Reputation: 11
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.
Upvotes: 1
Views: 1281
Reputation: 128
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'); ?>
Upvotes: 0