Hi,
I’m building a newsletter module. For some reasons I choose to use different content blocks instead of one big WYSIWYG editor.
So I got the tables (simplified):
newsletter
id
title
newsletter_item
id
newsletter_id
type
title
description
newsletter_item_text
id
item_id
content
newsletter_item_image
id
item_id
image
newsletter_item_product
id
item_id
name
description
price
etc.
This way I have full control over the content and images and I know for sure the newsletter layout will always be the same.
In the CMS I’ve got a newsletter page. I can create a new newsletter. In this newsletter I can create content items. And I can drag and drop the items to order them. So far no problem. But in this gridview of items I want to be able to click a button to edit the items content. I manage to create different buttons for different types, pointing to different controllers. So far so good, but the problem is now I don’t have the id of the item. Because the newsletter_item table won’t holds the id of newsletter_item_image for example. Of course I could store this Id into the newsletter_item table but that feels kinda wrong. Two tables having id keys pointing to each other…
Where did I go wrong? Someone who done something like this and know a better approach?