Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- this represents json objects in the mongodb and in the client
- */
- var page = {
- content: {
- title: 'Page Title',
- slug: 'page_title',
- content: 'page content',
- footer: 'page footer content',
- },
- sub_page_1: {
- content: {
- title: 'SubPage Title',
- slug: 'subpage_title',
- content: 'subpage content',
- footer: 'subpage footer content',
- }
- sub_sub_page_1: {
- content: {
- //as the others above
- }
- }
- },
- sub_page_2:
- as the first above
- }
- OR
- var page = {
- content: {
- title: 'Page Title',
- //and so on
- }
- }
- var sub_page = {
- content: {
- //and so on
- }
- }
- var sub_sub_page = {
- content: {
- //and so on
- }
- }
- /*
- the second would allow to easily get the content of every single page, sub and subsubpage,
- whilst the first one is more beautiful in my eyes.
- which one should i prefer?
- */
Add Comment
Please, Sign In to add comment