Relmos Posted November 6, 2013 Share Posted November 6, 2013 Hi, would it be possible to move fields within a template on edit? Like: Intro Text 1 Text 2 Move: Intro Text 2 Text 1 I do not mean the option on template edit but within the page edit as an option for the client. - Relmos Link to comment Share on other sites More sharing options...
diogo Posted November 6, 2013 Share Posted November 6, 2013 That's not possible unless you use a repeater for the text fields. Link to comment Share on other sites More sharing options...
Relmos Posted November 6, 2013 Author Share Posted November 6, 2013 Hm, ok. That's what I thought about, too. The only problem is that this field is already a repeater in my case. And as far as I know nesting repeaters is not possible. Link to comment Share on other sites More sharing options...
Raymond Geerts Posted November 6, 2013 Share Posted November 6, 2013 You could use a repeater for the text field. With that the customer can add / remove and sort the text fields quite easy. http://processwire.com/videos/repeater-field-type/ http://processwire.com/api/fieldtypes/repeaters/ Link to comment Share on other sites More sharing options...
Relmos Posted November 6, 2013 Author Share Posted November 6, 2013 @Raymond Thank's for you quick answer, too. As I just answered to @diogo the problem ist, that the fieldtypes in my case are already repeaters and nesting is not possible. I could image a much more flexible case like: Intro Video Text1 Gallery Text 2 Move: Intro Gallery Video Text 1 Text 2 Just now I couldn't image how this would be possible. So by now this isn't possible yet? I asked this question cause I just saw that Craft has introduced this: http://buildwithcraft.com/features/matrix Link to comment Share on other sites More sharing options...
Raymond Geerts Posted November 6, 2013 Share Posted November 6, 2013 As its mentioned in the following topic it should not be a problem to nest different repeaters http://processwire.com/talk/topic/1358-repeater-inside-itself/ Repeatersshould be okay with putting repeater B inside repeater A. But if youare putting repeater A inside repeater A… all bets are off. We'll have to add some extra checking for the folks that need the infinite recursive depth repeater features in their site. Link to comment Share on other sites More sharing options...
Relmos Posted November 6, 2013 Author Share Posted November 6, 2013 Allright, thank you. Then I'll give it a try. Link to comment Share on other sites More sharing options...
diogo Posted November 6, 2013 Share Posted November 6, 2013 Doesn't sound like a great plan. I would rethink the structure if I were you. Link to comment Share on other sites More sharing options...
Relmos Posted November 6, 2013 Author Share Posted November 6, 2013 Ok here the real scenario: Type 1 Repeater Type 2 Repeater Type 3 Repeater Since now the Types are each a fieldtype and hardcoded in the template. Now the client wants to be able to add more types and reorder them on demand. Since there's only the repeater solution now I cannot think of anything different than embed repeater B in repeater A. Or? Link to comment Share on other sites More sharing options...
Raymond Geerts Posted November 6, 2013 Share Posted November 6, 2013 Perhaps its possible to split it up to different pages. Where each type is a seperated page. But im not sure what your exact structure is. By the way: i never have tried using a repeater inside a different repeater myself Link to comment Share on other sites More sharing options...
pogidude Posted November 7, 2013 Share Posted November 7, 2013 Maybe you'll want to describe the whole thing in more detail? Like the structure of the elements in the page, what the elements are for and such. If anything else, someone here might be able to help you *rethink* how to better implement things. who knows, maybe you don't need a repeater Link to comment Share on other sites More sharing options...
diogo Posted November 10, 2013 Share Posted November 10, 2013 Sorry to get back to you only now. What I meant is that it sound like a complicated solution and in PW, if it sounds complicated it's because there is a more efficient way. Like pogidude says, tells us what you want to do in more detail so we can help you to have a better structure. Link to comment Share on other sites More sharing options...
dragan Posted November 11, 2013 Share Posted November 11, 2013 I've never used repeaters myself, but if these were "regular" input-fields, I'd just add a text- or textarea input field to the template(s). Inside these, the editor could list the fieldnames (separated by comma or linebreak), and this would dictate the placement / order of fields in the template. Convert the "fieldOrder" from text to an array, and just output them in that order in the tpl. Certainly not as elegant as drag-and-dropping fields in the admin edit area, but simple enough. I'm not sure though how to access / adress repeater fields though, so that might or might not work for your scenario. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now