Can someone help me figure out why this isn't working. It's actually group="content" plugin. I followed examples that I barely found on internet, but it was not enough. Following code was claimed to work but it does not for me.
Here is my onContentPrepareForm
function onContentPrepareForm($form, $data) { echo "working aroptimizer ";
if (!($form instanceof JForm)) {
$this->_subject->setError('JERROR_NOT_A_FORM');
return false;
}
// Check we are manipulating a valid form.
if (!in_array($form->getName(), array('com_contact.article'))) {
return true;
}
// Add the fields to the form.
JForm::addFormPath(dirname(__FILE__) . '/inc');
$form->loadFile('arform', false);
return TRUE;
}
and in inc/arform.xml I have following:
<?xml version="1.0" encoding="UTF-8"?>
<form>
<fields name="aroptimizer">
<fieldset name="ar"
label="AR Optimizer">
<field name="ar" type="list" label="Audience Match" description="Select your audience">
<option value="1">JSELECT</option>
<option value="1">DEPT_SALES</option>
<option value="2">DEPT_SUPPORT</option>
<option value="3">DEPT_BILLING</option>
<option value="4">DEPT_OTHER</option>
</field>
</fieldset>
</fields>
</form>
Goal for the above code is just to display form fields. All I wanna do is show some form fields to com_content(?option=com_content) page.
Thank You.
--
You received this message because you are subscribed to a topic in the Google Groups "Joomla! General Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/joomla-dev-general/UP8X-slm98E/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to joomla-dev-gene...@googlegroups.com.
To post to this group, send an email to joomla-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/groups/opt_out.
Yes it does. My next question is how do I show options in there dynamically? I means I'll be making calls to 3rd party api and get objects to display as drop down.
--
To unsubscribe from this group and all of its topics, send an email to joomla-dev-general+unsub...@googlegroups.com.
To unsubscribe from this group and all of its topics, send an email to joomla-dev-gene...@googlegroups.com.
Custom field type creation documentation is here: http://docs.joomla.org/Creating_a_custom_form_field_type
--