Jump to content

Repeatable Fields


ryan

Recommended Posts

Thanks Ryan - sounds like you are on it :)

Yeah, I figured they weren't a replacement for pages when dealing with lots of entries. Definitely a great option to have in the arsenal though and I think they will be much friendlier for the client with those couple of enhancements.

  • Like 1
Link to comment
Share on other sites

I am receiving this error when I add a new page (clicking on pages) & also click AddItem to add more repeater items.

Error    Maximum function nesting level of '100' reached, aborting! (line 95 of D:\wamp\www\pwabc\processwire\wire\core\Data.php)

I have a repeater field with two repeater fields : one a text type and second one, page(array) type.
I have set Ready to Edit Repeater Items as 0.
Using Processwire version - ProcessWire-2.2.9-9

Kindly tell me what might have caused this error.
Thanks a lot.

Link to comment
Share on other sites

Repeater shouldn't be excessively used and nested. It's not built for that use and will likely cause some problems. I thougth Ryan decided to put a restriction already to prevent nested repeaters. Anyhow there seems to be a function going nested wild and is limited per some setting on server or php I think.

Link to comment
Share on other sites

Thank you for your replies.

But I removed the repeater field and created the field again with just 2 fields (one a text type and second one, page(array) type) as before.

I have added just one repeater item in the page.

And, I am getting this error again.

Link to comment
Share on other sites

  • 2 months later...

Hey there,

PW is great and so are repeaters.

But i am bothered by great amounts of items in a repeater-field. So much to scroll... :-)

Is it possible to change the settings in a way that when a page is loaded in the manager, the repeater-field itself is visible, but the populated items in it are collapsed by default?

Thank you for your support.

Link to comment
Share on other sites

You can define that option on the fields themselves. Go to input -> visibility, and choose "always collapsed". If it works on templates, it must work inside repeaters...

But in my opinion, if you feel that need, you shouldn't be using repeaters. Repeaters are supposed to make your life easier and spare you from some clicks, not the opposite. If what you describe is happening, I would say, use normal pages instead.

Link to comment
Share on other sites

diogo, thank you for your reply.

Perhaps my description was bad. Repeaters fit perfect for the needs of the project and the costumers are in love with it, because they understand it in a second.
In my point of view, there is no need to use pages. It's just a little bit of cosmetics to the usability in the admin.

Your suggested solution doesn't work, because in case of "allways collapsed" the whole "repeater" is collapsed.
I just want to collapse the items (not the fields) inside by default.

Any further suggestions?

Thanks.

Link to comment
Share on other sites

I didn't mean to do it on the repeater field settings, but on the settings of each of the fields that are inside the repeater. I will try it.

edit: it seems to work:

post-88-0-92544900-1365983533_thumb.png

Link to comment
Share on other sites

Quick and dirty solution would be to had this line to your admin-theme:

$(".Inputfield_repeater .ui-sortable > li").addClass("InputfieldStateCollapsed");

you could add it in the end of the main.js file for instance

$(document).ready(function() {
    ProcessWireAdminTheme.init();

    // very dirty hack to collapse the repeaters, make something nicer later
    $(".Inputfield_repeater .ui-sortable > li").addClass("InputfieldStateCollapsed");
}); 
  • Like 3
Link to comment
Share on other sites

We'll be adding more configurability to repeaters in the next version or so, including an option to have them collapsed by default (the repeater items themselves), ability to control labels of repeater items, and automatic sorting. 

  • Like 2
Link to comment
Share on other sites

Quick and dirty solution would be to had this line to your admin-theme:

$(".Inputfield_repeater .ui-sortable > li").addClass("InputfieldStateCollapsed");

you could add it in the end of the main.js file for instance

$(document).ready(function() {
    ProcessWireAdminTheme.init();

    // very dirty hack to collapse the repeaters, make something nicer later
    $(".Inputfield_repeater .ui-sortable > li").addClass("InputfieldStateCollapsed");
}); 

diogo,

thank you for your quick and dirty solution.

Does it work in your projects? Here the "repeaters" still stay open.

Ryan, that's really good news! We are looking forward to the next version (or so) :-)

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

hi everyone,

is there a way to only allow 1 image per repeater field (repeater with input type image) to be uploaded. I guess it could be confusing for an user to have the option to upload several pictures for the same repeater item:

qp6jM9v.jpg

thanks a lot, cheers, j

Link to comment
Share on other sites

  • 1 month later...

Sorry. I thought you meant changing the order of repeater fields within a page....

Repeaters are pages as well (check under Admin if unsure about this). I have just checked and I can manually change the order of repeater pages via PW drag-and-drop (move). They stick to their positions in the tree. However, for some reason, the order is not being respected when outputting the repeaters, even when I specify sort=sort in my selector. I must be doing something weird (or need right settings in my template) since other sort options are working, e.g. sort=title. Don't have time to test right now but you can try and see how it goes..

Edit:

strike through...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...