×
This forum has been locked. Please submit new Feature Requests on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
add new Joomla field type 'Subform'
Randy Carey
Junior Member
Posts: 23
8 года 4 мес. назад - 8 года 4 мес. назад #1409
от Randy Carey
Randy Carey создал тему: add new Joomla field type 'Subform'
In one of my components I just converted a couple of fields to the new field type 'subform' (introduced in Joomla 3.6, and to replace the 'repeatable' field type): docs.joomla.org/Subform_form_field_type
I am impressed with what this new type offers. The content manager can dynamically add as many items as he/she needs, quickly delete an item, and can drag-and-drop to reorder. And I am able to define the single or set of Joomla field types that exist within a the repeatable section.
The value of this field type probably exceeds what I currently envision - users are bound to come up with various applications. For one thing, it addresses a request I made a couple of months ago for the ability to reorder multiple items that I selected in a field (e.g., order a set of multiple authors, multiple images, or multiple links).
I did have to read the nascent documentation and experiment a bit to get it to work. For me, the database field type is 'text' and in the admin side I had to add some code to the table class that converts the result from a stdClass to a JSON string (for storage in the db). On the frontend I had to decode the JSON string into an object from which I got the values to display. That seemed to be all the extra coding I had to do (beyond making the 'subform' declaration in the xml file and creating a short xml file for the repeatable subform.
So there is no need to invent this functionality - rather offer it as another field type. I do realize that this would probably be a bit more challenging field type for you to implement, as the field is dependent upon a second form (the 'subform') that gets repeated by the 'subform' field.
I am impressed with what this new type offers. The content manager can dynamically add as many items as he/she needs, quickly delete an item, and can drag-and-drop to reorder. And I am able to define the single or set of Joomla field types that exist within a the repeatable section.
The value of this field type probably exceeds what I currently envision - users are bound to come up with various applications. For one thing, it addresses a request I made a couple of months ago for the ability to reorder multiple items that I selected in a field (e.g., order a set of multiple authors, multiple images, or multiple links).
I did have to read the nascent documentation and experiment a bit to get it to work. For me, the database field type is 'text' and in the admin side I had to add some code to the table class that converts the result from a stdClass to a JSON string (for storage in the db). On the frontend I had to decode the JSON string into an object from which I got the values to display. That seemed to be all the extra coding I had to do (beyond making the 'subform' declaration in the xml file and creating a short xml file for the repeatable subform.
So there is no need to invent this functionality - rather offer it as another field type. I do realize that this would probably be a bit more challenging field type for you to implement, as the field is dependent upon a second form (the 'subform') that gets repeated by the 'subform' field.
Последнее редактирование: 8 года 4 мес. назад пользователем Randy Carey. Причина: clarity
Спасибо сказали: Søren Beck Jensen, Tomasci
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Søren Beck Jensen
Administrator
Posts: 81
8 года 4 мес. назад #1411
от Søren Beck Jensen
Søren Beck Jensen
Founder, Component-Creator.com
Søren Beck Jensen ответил в теме add new Joomla field type 'Subform'
We are definitely going to be implementing the new sub field asap. For now we have a feature freeze on Component Creator as we are hard at work developing a brand new design and interface.
Thank you very much for your feedback. It is as always very welcome.
Thank you very much for your feedback. It is as always very welcome.
Søren Beck Jensen
Founder, Component-Creator.com
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Tomasci
New Member
Posts: 17
7 года 10 мес. назад #1497
от Tomasci
Tomasci ответил в теме Repeatable 'Subform'
Hello.
Is there any ETA on this feature?
Or is there any tutorial on how to implement it manually?
I am making a cars database. I would like to create a repeatable field group for image, alt and title tags. And I want the images to be sortable. I understand it could be achieved using the subform?
Thanks
Is there any ETA on this feature?
Or is there any tutorial on how to implement it manually?
I am making a cars database. I would like to create a repeatable field group for image, alt and title tags. And I want the images to be sortable. I understand it could be achieved using the subform?
Thanks
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Randy Carey
Junior Member
Posts: 23
7 года 10 мес. назад #1501
от Randy Carey
Randy Carey ответил в теме Repeatable 'Subform'
Yes, this feature will allow you to define a form for fields in XML and then make those repeatable. The individual subforms (mini data records) can be easily dragged and dropped to be ordered and they will retain that order.
I did list (in my initial post) a summary of what I had to do. I declared a text field (so that the database will not limit the amount of space dedicated to this field) and then I changed the XML file (of the table) so that this text field is now a subform with all the attributes needed by this field. If you contact me through careytech.com, I will be able to share an example of my solution. If you have such an example in hand, you will surely avoid a lot of the potholes that tripped me up as I was searching for a workable implementation.
I did list (in my initial post) a summary of what I had to do. I declared a text field (so that the database will not limit the amount of space dedicated to this field) and then I changed the XML file (of the table) so that this text field is now a subform with all the attributes needed by this field. If you contact me through careytech.com, I will be able to share an example of my solution. If you have such an example in hand, you will surely avoid a lot of the potholes that tripped me up as I was searching for a workable implementation.
Спасибо сказали: Andres Maeso
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Tomasci
New Member
Posts: 17
7 года 10 мес. назад #1502
от Tomasci
Tomasci ответил в теме Repeatable 'Subform'
Hi Randy,
I will send a request via your website.
Currently my (secondhand) car component has 3 tables: Manufacturers, Models and Cars.
In the cars table I want to create a repeatable subform with 3 fields: image, image alt-tag, image title-tag
Do I understand this correctly?
I do not need an extra table (4) for the images? The repeatable subform images and data will be stored in the cars table?
I should just create 1 text field, then somehow convert this 1 field to 3 fields manually?
Many thanks!
I will send a request via your website.
Currently my (secondhand) car component has 3 tables: Manufacturers, Models and Cars.
- Manufacturer is just 1 text field for the name
- Models is a foreign key field to the manufacturers and a text field for the model name
- In cars table I have price, mileage, year of registration, ...
In the cars table I want to create a repeatable subform with 3 fields: image, image alt-tag, image title-tag
Do I understand this correctly?
I do not need an extra table (4) for the images? The repeatable subform images and data will be stored in the cars table?
I should just create 1 text field, then somehow convert this 1 field to 3 fields manually?
Many thanks!
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Время создания страницы: 0.094 секунд