I'm developing a CMS for a website that has editable pages and separate editable callouts. Since a callout can appear on multiple pages, I need a way to keep track of what pages they are linked to. At the moment I have this set up:
- a "pages" table and "sections" table both of which can have callouts
- "callouts" table
- "callout_connector" table with id, page_id, callout_id, and type
On the admin page to edit the pages, i have a checkbox list of the callouts. This seemed to be a good idea but then I started thinking about the complications of updating or adding new pages...
If I simply delete the rows in the "callout_connector" that pertain to the page every time you edit it and then add new rows, the auto-increment id could potentially get huge.
So now I'm thinking about adding a "visible" field to "callout_connector" and creating an entry for every page/callout combination so the only thing that needs to be updated is the visibility. But this gets a little bit complicated because every time the user creates a new page, i'll have to add that page and all of the potential callouts to the table. And vice versa if a new callout is created.
Anyone have any ideas about the best ways to set something like this up?
Thanks!