Jump to content

Move fields within a template possible on edit page?


Recommended Posts

Posted

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

Posted

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.

Posted

@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

Posted

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/

Repeaters
should be okay with putting repeater B inside repeater A. But if you
are 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. :)

Posted

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?

Posted

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

Posted

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 :)

Posted

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.

Posted

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.

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...