I would like to add a similar to default articles tag field type: A dropdown with predefined selects, but someone can add their own values also.
What type of field type is this? And how could I add it inside a custom component?
Joomla Stack Exchange is a question and answer site for Joomla! administrators, users, developers and designers. It only takes a minute to sign up.
Sign up to join this communityTo save me repeating it all here, I'll link to this helpful article that explains it step by step:
http://magazine.joomla.org/issues/issue-apr-2103/item/1225-joomla-tag-field
You can use the Tag form field type. This field type is available in Joomla 3.1 and newer, and works basically like this:
<field name="tags" type="tag" label="JTAG" description="JTAG_DESC" mode="ajax" class="inputbox span12 small" multiple="true" />
Note that mode="ajax"
is required in order to allow on-the-fly tag creation.
More information on using tags in your extension can be found here.
Use the tag form field type:
//Get custom field
$getInput = JFormHelper::loadFieldType('Tag', false);
$taginput = $tags->getInput();
https://docs.joomla.org/Creating_a_custom_form_field_type#Not_linked_with_a_form