Reputation: 4500
I'm using Symfony2 and Doctrine2 to create a blog engine. I will have three types of contents, so I created this, using inheritance :
Next, I want to have "blocks" of text that can be inserted after any "content", so I do :
Now my problem is : How can I store the information that some blocks should be included by default with certain types of contents ?
Example : say I have a "social" block (includes the facebook button, a tweet button, etc.). I want it to be linked by default in any new "blog" content.
Upvotes: 2
Views: 112
Reputation: 839
If the default block, like "facebook" button, won't be different between different contents. You may consider generating block from the code instead of database for better performance.
Otherwise, if users could customize these buttons after new content is inserted, you just insert "default block" after insert a new content in code. The relational data model can't help if the default data is complicated.
Upvotes: 1