Jump to content

Repeaters in Custom Process Modules


Recommended Posts

I see old posts saying that repeaters are not the way to go in Custom Process Modules. If that is the case, when using forms (as I am trying to do) how would one tackle things like repeat contact fields where there can be multiple requirements for contact details with different parameters? (Like point of contact, director, etc) or even telephone numbers that have different uses?

Just for background I am creating a process module that allows me to create types of financial applications in the admin area (no need to publish any of this, pure admin) that require a lot of personal or company information.

Maybe I am thinking about this incorrectly?

Link to comment
Share on other sites

9 hours ago, opalepatrick said:

Just for background I am creating a process module that allows me to create types of financial applications in the admin area (no need to publish any of this, pure admin) that require a lot of personal or company information.

I would question why you are going down the road of a Process module rather than the standard way of entering and storing data in PW, which is via pages and the Page Edit interface. I expect you will want to store the data that your users are entering, and the simplest way to do that is in pages.

And when it comes to providing edit forms for that data Page Edit is going to have a lot of advantages:

  • You probably already understand how fields are added to templates and how fields are presented in Page Edit, so there's less to learn.
  • You can add/sort/arrange fields via the admin GUI rather than in code.
  • You get access control for editing out-of-the-box.
  • You can use the full range of PW fieldtypes and inputfields, many of which wouldn't be usable within a Process module (Repeater, ProFields Table, etc).

Is there something in particular you are wanting to do that you don't think would be possible via pages and Page Edit?

  • Like 1
Link to comment
Share on other sites

Moderator note: this is not a module support thread, so I'm moving it to the Module/Plugin Development sub-area of the forum instead. Please keep in mind that the Modules/Plugins main area is only intended for module-specific support threads. Thanks!

Link to comment
Share on other sites

I was attracted to the idea of pulling everything together in a process module as per @bernhard's excellent toots. I liked the idea that they were all in admin and not possible to accidentally publish to the web. But now I have thought about it and following your reply (Thank you) I realise that I should be looking at protecting the templates by user role and using all the tools available to me. I have just gone down the "over-complicating things" road. Wish I hadn't gone down that rabbit hole before the weekend! Thanks once again.

Link to comment
Share on other sites

Horses for courses, I think @opalepatrick. PW is undoubtedly an excellent tool for admin-type applications. I have done a couple (a membership system with an integrated public website and a holiday cottage booking system which is loosely-coupled to a public website) and have found that it works well. However, you do need to think about the design quite carefully if you want it to perform elegantly and be maintainable. So far I haven't found any really good tutorials on this topic. The systems I have built tend to have the following characteristics:

  • Use PW's page-based structure as far as possible for the database and straightforward edits;
  • Use existing modules that suit the purpose to avoid re-inventing the wheel - I find ConnectPageFields and RuntimeMarkup/RuntimeOnly particularly useful;
  • Use process modules for custom user interfaces - typically using MarkupAdminDataTable;
  • Use the access control tools as required - I also use the RestrictTabView module;
  • Use Listerpro for ad-hoc reporting;
  • Tweak the interface as necessary with js.

Inevitably you will take some wrong turnings, but PW is a great prototyping tool and genrally not too much time is wasted (certainly not compared with doing the design wrong in pure php).

And the forum is great too, if your brain starts to hurt, as mine seems to frequently ? 

  • Like 1
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
 Share

×
×
  • Create New...