3

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.

Joomla tags form field type

What type of field type is this? And how could I add it inside a custom component?

3 Answers 3

2

To 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

4
  • Very detailed article, athough it describes the proccess for adding it at backend. Im trying to add it at the frontend.
    – sin
    Dec 1, 2015 at 9:40
  • The process for adding it in the frontend should be just as simple :)
    – user239
    Dec 1, 2015 at 12:28
  • Altough i cant find a way to do it :(
    – sin
    Dec 2, 2015 at 7:25
  • @sin, I can confirm that adding field is not complicated for FE, same as for BE, but you should prepare your custom component to use it. to do this you need to add jtableobservertags and your custom content-type. I can post full explanation if this is what you're looking for.
    – Alexandr
    May 29, 2016 at 13:15
0

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.

1
  • My bad for not mentioning it. I need to add it at frontend not at backend. At the article you added, there is a way called "Batch Proccessing" but when i add the code it gives me back ONLY the dropdown list .
    – sin
    Dec 1, 2015 at 9:37
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.