New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] A Repeatable Custom Field #20243

Closed
wants to merge 21 commits into
base: 3.10-dev
from

Conversation

@roland-d
Contributor

roland-d commented Apr 26, 2018

Summary of Changes

This pull request adds a new custom field to the core of Joomla. This custom field is called Repeatable because it allows users to enter a repeatable list of items which in turn are by default shown as a list. With a template override you can do a whole lot of other things with this.

Testing Instructions

Installation

  1. Copy all the files to their respective location in your site
  2. Go to Extensions -> Manage -> Discover
  3. In the list find Fields - Repeatable
    image
  4. Select this plugin
  5. Click on Install
  6. Go to Extensions -> Plugins
  7. Filter the list on repeat
  8. Select this plugin
    image
  9. Click Enable

Usage

  1. Go to Content -> Fields
  2. Click New
  3. Give the Custom Field a Title of Marbles
  4. As Type select Repeatable (repeatable)
  5. At the bottom click on the green + to add a new field
    image
  6. Enter the name of the field Size
  7. Select a type of field Text
  8. Click again on the green +
  9. Enter the name of the field Description
  10. Select a type of field Text Area
  11. Save the custom field and it looks like this:
    image
  12. Close the custom field
  13. Click on Articles
  14. Click on New
  15. Give the Article a Title of All about marbles
  16. Click on the Fields tab
  17. Click on the green + sign to add a new line
  18. Enter the text Small
  19. Enter the description I want to make this marble grow
  20. Click on the green + sign to add a new line
  21. Enter the text Medium
  22. Enter the description I have been growing this for a while
  23. Click on the green + sign to add a new line
  24. Enter the text Large
  25. Enter the description It is as big as it gets
  26. Your table now looks like this:
    image
  27. Save and close the article
  28. Now view the article on the site
  29. Your article should look like this:
    image

There you have a it. Users can now create their own lists. If you are creative, you can use it to make tables or other kinds of lists.

Feedback

Let me know if this is something to be considered for core. If not, I will just close this request.

@brianteeman

This comment has been minimized.

Show comment
Hide comment
@brianteeman

brianteeman Apr 26, 2018

Contributor

What are the advantages/differences over this field and the existing list field?

Contributor

brianteeman commented Apr 26, 2018

What are the advantages/differences over this field and the existing list field?

@brianteeman

This comment has been minimized.

Show comment
Hide comment
@brianteeman

brianteeman Apr 26, 2018

Contributor

As its a new core plugin it needs to be added to the list in libraries/src/Extension/ExtensionHelper.php

Contributor

brianteeman commented Apr 26, 2018

As its a new core plugin it needs to be added to the list in libraries/src/Extension/ExtensionHelper.php

@Septdir

This comment has been minimized.

Show comment
Hide comment
@Septdir

Septdir Apr 26, 2018

Contributor

@roland-d Why do not you want to make a separate plugin and add it to JED ?

The field looks quite useful and will probably be in demand

Why do you need to add it to the core ?

Contributor

Septdir commented Apr 26, 2018

@roland-d Why do not you want to make a separate plugin and add it to JED ?

The field looks quite useful and will probably be in demand

Why do you need to add it to the core ?

@roland-d

This comment has been minimized.

Show comment
Hide comment
@roland-d

roland-d Apr 26, 2018

Contributor

@brianteeman The distinct difference between these two is that with list you need to create the list when you create the custom field and is shown as select list to the end user. Displaylist allows the end user to create a list rather than make a selection. I hope that explains it.

@Septdir I don't want to maintain an extension on the JED. The field seems useful enough for the community, so I figured I share it.

Contributor

roland-d commented Apr 26, 2018

@brianteeman The distinct difference between these two is that with list you need to create the list when you create the custom field and is shown as select list to the end user. Displaylist allows the end user to create a list rather than make a selection. I hope that explains it.

@Septdir I don't want to maintain an extension on the JED. The field seems useful enough for the community, so I figured I share it.

@laoneo

This comment has been minimized.

Show comment
Hide comment
@laoneo

laoneo Apr 26, 2018

Member

As we do have a list already, I would rather see a new function in core to define a default layout for the field and provide different layouts for the same field type. For the list it would mean to add a new file here like /plugins/fields/list/tmpl/list_ul.php and then provide these layouts as option in the field. What do you guys think?

Member

laoneo commented Apr 26, 2018

As we do have a list already, I would rather see a new function in core to define a default layout for the field and provide different layouts for the same field type. For the list it would mean to add a new file here like /plugins/fields/list/tmpl/list_ul.php and then provide these layouts as option in the field. What do you guys think?

@brianteeman

This comment has been minimized.

Show comment
Hide comment
@brianteeman

brianteeman Apr 26, 2018

Contributor

thanks @roland-d makes sense now - which it should have done because the name is perfect - sorry

Contributor

brianteeman commented Apr 26, 2018

thanks @roland-d makes sense now - which it should have done because the name is perfect - sorry

@brianteeman

This comment has been minimized.

Show comment
Hide comment
@brianteeman

brianteeman Apr 26, 2018

Contributor

@laoneo something like
display as select/ul/ol/ etc?

Contributor

brianteeman commented Apr 26, 2018

@laoneo something like
display as select/ul/ol/ etc?

@laoneo

This comment has been minimized.

Show comment
Hide comment
@laoneo

laoneo Apr 26, 2018

Member

Or like what we have as layouts in modules and views.

Member

laoneo commented Apr 26, 2018

Or like what we have as layouts in modules and views.

@roland-d

This comment has been minimized.

Show comment
Hide comment
@roland-d

roland-d Apr 26, 2018

Contributor

@laoneo I thought of adding options to select which layout it would have but for new decided against it because the output is generally styled via a template anyway. So I figured, why add even more options.

Contributor

roland-d commented Apr 26, 2018

@laoneo I thought of adding options to select which layout it would have but for new decided against it because the output is generally styled via a template anyway. So I figured, why add even more options.

@brianteeman

This comment has been minimized.

Show comment
Hide comment
@brianteeman

brianteeman Apr 26, 2018

Contributor

@laoneo I thought of adding options to select which layout it would have but for new decided against it because the output is generally styled via a template anyway. So I figured, why add even more options.

@roland-d I think he meant not to add this new field but to add this as a layout to the current select list field

Contributor

brianteeman commented Apr 26, 2018

@laoneo I thought of adding options to select which layout it would have but for new decided against it because the output is generally styled via a template anyway. So I figured, why add even more options.

@roland-d I think he meant not to add this new field but to add this as a layout to the current select list field

roland-d added some commits Apr 26, 2018

@roland-d

This comment has been minimized.

Show comment
Hide comment
@roland-d

roland-d Apr 26, 2018

Contributor

@brianteeman Ok, if that is what he meant than that would be a feature based on the existing list field and serves a different purpose.

Contributor

roland-d commented Apr 26, 2018

@brianteeman Ok, if that is what he meant than that would be a feature based on the existing list field and serves a different purpose.

@laoneo

This comment has been minimized.

Show comment
Hide comment
@laoneo

laoneo Apr 26, 2018

Member

Whats the difference of this plugin to the list field? Only the layout or not? The rest is more or less the same.

Member

laoneo commented Apr 26, 2018

Whats the difference of this plugin to the list field? Only the layout or not? The rest is more or less the same.

@roland-d

This comment has been minimized.

Show comment
Hide comment
@roland-d

roland-d Apr 26, 2018

Contributor

@laoneo Apparently my two tries so far have failed to make clear what this plugin does different so going to give it another try. It is not the layout, otherwise I would have added that as an option to the list.

Here is an image to show you the difference:
image

The existing List is a dropdown, the new Display List allows the one consuming the article to enter a list by themselves rather than having to choose from a fixed list. This can be a usergroup that has no access to maintain the custom fields but has access to create articles. To me this is a distinct difference between these two fields.

Contributor

roland-d commented Apr 26, 2018

@laoneo Apparently my two tries so far have failed to make clear what this plugin does different so going to give it another try. It is not the layout, otherwise I would have added that as an option to the list.

Here is an image to show you the difference:
image

The existing List is a dropdown, the new Display List allows the one consuming the article to enter a list by themselves rather than having to choose from a fixed list. This can be a usergroup that has no access to maintain the custom fields but has access to create articles. To me this is a distinct difference between these two fields.

@AndyGaskell

This comment has been minimized.

Show comment
Hide comment
@AndyGaskell

AndyGaskell Apr 26, 2018

Contributor

I think this would be nice, and a feature that a lot of folk would find useful.
I do agree with @laoneo though, there is quite a big overlap with the current list item.

Perhaps an addition to the existing list plugin, with an option of choosing tmpl output. So, perhaps to go with the list.php we could add a ul.php and a li.php, and a way of choosing the display when editing the list, as per template overrides.

Contributor

AndyGaskell commented Apr 26, 2018

I think this would be nice, and a feature that a lot of folk would find useful.
I do agree with @laoneo though, there is quite a big overlap with the current list item.

Perhaps an addition to the existing list plugin, with an option of choosing tmpl output. So, perhaps to go with the list.php we could add a ul.php and a li.php, and a way of choosing the display when editing the list, as per template overrides.

@brianteeman

This comment has been minimized.

Show comment
Hide comment
@brianteeman

brianteeman Apr 26, 2018

Contributor

@roland-d i get it

Contributor

brianteeman commented Apr 26, 2018

@roland-d i get it

Language update
Removed obsolete form field settings
@joomlara

This comment has been minimized.

Show comment
Hide comment
@joomlara

joomlara May 19, 2018

I have tested this item successfully on f6542e0


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20243.

joomlara commented May 19, 2018

I have tested this item successfully on f6542e0


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20243.

@joomlara

This comment has been minimized.

Show comment
Hide comment
@joomlara

joomlara May 19, 2018

Works as expected. Nice feature!
And unlike Yves, I really liked your clear testing instructions Roland....
marbles

joomlara commented May 19, 2018

Works as expected. Nice feature!
And unlike Yves, I really liked your clear testing instructions Roland....
marbles

@ot2sen

This comment has been minimized.

Show comment
Hide comment
@ot2sen

ot2sen May 19, 2018

Contributor

I have tested this item successfully on e13a749

Still works


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20243.

Contributor

ot2sen commented May 19, 2018

I have tested this item successfully on e13a749

Still works


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20243.

@franz-wohlkoenig

This comment has been minimized.

Show comment
Hide comment
@franz-wohlkoenig

franz-wohlkoenig May 19, 2018

Why is only one Test count as successful?

franz-wohlkoenig commented May 19, 2018

Why is only one Test count as successful?

@Quy

This comment has been minimized.

Show comment
Hide comment
@Quy

Quy May 19, 2018

Contributor

Because joomlara tested the commit (f6542e0) before the last commit (e13a749).

Contributor

Quy commented May 19, 2018

Because joomlara tested the commit (f6542e0) before the last commit (e13a749).

@roland-d

This comment has been minimized.

Show comment
Hide comment
@roland-d

roland-d May 19, 2018

Contributor

With the number of tests this PR has gotten and the last commit being trivial one could say it has had enough tests ;)

Contributor

roland-d commented May 19, 2018

With the number of tests this PR has gotten and the last commit being trivial one could say it has had enough tests ;)

@joomla-cms-bot joomla-cms-bot removed this from the Joomla 3.10.0 milestone May 19, 2018

@Quy

This comment has been minimized.

Show comment
Hide comment
@Quy

Quy May 19, 2018

Contributor

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20243.

Contributor

Quy commented May 19, 2018

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20243.

@joomla-cms-bot joomla-cms-bot added the RTC label May 19, 2018

mbabker added a commit that referenced this pull request May 19, 2018

@mbabker mbabker added this to the Joomla 3.9.0 milestone May 19, 2018

@mbabker

This comment has been minimized.

Show comment
Hide comment
@mbabker

mbabker May 19, 2018

Member

Merged to 3.9 via 327fa65

Member

mbabker commented May 19, 2018

Merged to 3.9 via 327fa65

@mbabker mbabker closed this May 19, 2018

@joomla-cms-bot joomla-cms-bot removed the RTC label May 19, 2018

@laoneo

This comment has been minimized.

Show comment
Hide comment
@laoneo

laoneo Jun 2, 2018

Member

For the people who are requesting a layout chooser per field, It got merged today by #18571.

Member

laoneo commented Jun 2, 2018

For the people who are requesting a layout chooser per field, It got merged today by #18571.

@roland-d roland-d deleted the roland-d:feature/custom-list-input-field branch Jun 3, 2018

@coolcat-creations

This comment has been minimized.

Show comment
Hide comment
@coolcat-creations

coolcat-creations Jun 26, 2018

Contributor

Hi there! Is there a way to fix the appereance of the Media field? Is it related to the repeatable field or a separate issue?
grafik

Contributor

coolcat-creations commented Jun 26, 2018

Hi there! Is there a way to fix the appereance of the Media field? Is it related to the repeatable field or a separate issue?
grafik

@roland-d

This comment has been minimized.

Show comment
Hide comment
@roland-d

roland-d Jun 26, 2018

Contributor

Hello, this is a separate issue. The styling just doesn't fit.

Contributor

roland-d commented Jun 26, 2018

Hello, this is a separate issue. The styling just doesn't fit.

@coolcat-creations

This comment has been minimized.

Show comment
Hide comment
@coolcat-creations

coolcat-creations Jun 26, 2018

Contributor

Sorry for the late testing... But if you use 2 editor fields with JCE you can't type in into the second editor field. I know it's not core related (With TinyMCE everything works fine) but maybe something that can be still fixed?

Contributor

coolcat-creations commented Jun 26, 2018

Sorry for the late testing... But if you use 2 editor fields with JCE you can't type in into the second editor field. I know it's not core related (With TinyMCE everything works fine) but maybe something that can be still fixed?

@coolcat-creations

This comment has been minimized.

Show comment
Hide comment
@coolcat-creations

coolcat-creations Jun 26, 2018

Contributor

Created the issue and will post the JCE one also towards JCE ;)

Contributor

coolcat-creations commented Jun 26, 2018

Created the issue and will post the JCE one also towards JCE ;)

@joomla joomla locked as resolved and limited conversation to collaborators Jun 26, 2018

@laoneo

This comment has been minimized.

Show comment
Hide comment
@laoneo

laoneo Jun 26, 2018

Member

I'm going to lock this one. If there are followup issues, please open a new issue or pull request. Thanks for understanding.

Member

laoneo commented Jun 26, 2018

I'm going to lock this one. If there are followup issues, please open a new issue or pull request. Thanks for understanding.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.