Populate a section list editor with data from a different section list

4 posts by 2 authors in: Forums > CMS Builder
Last Post: July 8, 2016   (RSS)

By kkegans - July 7, 2016 - edited: July 7, 2016

Is there a way to populate a section list editor with the content from a different section list editor?

I have a need to create a number of list editors that will use mostly the same list details, but each needs to be able to be separately edited. It would be really nice if I could create a master section editor that would automatically pre-populate each of the other page section editors..

CMSB Rocks!
Thanks,
Kurt

By kkegans - July 8, 2016

Thanks Daryl,

In this case, if the "master section" is subsequently updated, does it have any effect on the other records? If not, is there a method that would allow the other records to be updated when the "master record" was updated?

Kurt

CMSB Rocks!
Thanks,
Kurt

By Daryl - July 8, 2016

Hi Kurt,

> In this case, if the "master section" is subsequently updated, does it have any effect on the other records?

Yes, functions that are hooked to "record_postsave" will always be called whenever you save a record - adding a new one, or updating an existing record.

In addition to my example code, you should also check if the $tableName is equals to the table name of your master section.
So that your script for updating the records of other sections will only get executed when saving a record in your master section.

Cheers,

Daryl Maximo
PHP Programmer - interactivetools.com