Custom block with dynamic fields

Permalink
HI everyone. First off, sorry if this is a duplicate. I posted it a minute ago and there was an ajax problem. Anyways, I am new to concrete5 and have been browsing the forum but not finding the info I need.

I am creating a custom block which has a pair of content and author fields. I want to be able to dynamically add multiple content author pairs to the block by clicking a button and having a new pair appear for entry.

Can someone point me in the direction of how I can go about doing this?



Here are my current thoughts.
I us db.xml to create a table with an id, author, and content fields.
I create add and edit pages to dynamically add form fields with unique names for the author and content fields. for instance, author1, content1, author2, content2, etc.

On controller.php I create a script to parse each of the author content pairs and input them into the database as separate entries.

on the view, I display all author and content pairs that share the same id.



Thoughts?


Thank you.