Guest User

Untitled

a guest
Dec 11th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. /*
  2. this represents json objects in the mongodb and in the client
  3. */
  4. var page = {
  5. content: {
  6. title: 'Page Title',
  7. slug: 'page_title',
  8. content: 'page content',
  9. footer: 'page footer content',
  10. },
  11. sub_page_1: {
  12. content: {
  13. title: 'SubPage Title',
  14. slug: 'subpage_title',
  15. content: 'subpage content',
  16. footer: 'subpage footer content',
  17. }
  18. sub_sub_page_1: {
  19. content: {
  20. //as the others above
  21. }
  22. }
  23. },
  24. sub_page_2:
  25. as the first above
  26. }
  27.  
  28. OR
  29.  
  30. var page = {
  31. content: {
  32. title: 'Page Title',
  33. //and so on
  34. }
  35. }
  36.  
  37. var sub_page = {
  38. content: {
  39. //and so on
  40. }
  41. }
  42.  
  43. var sub_sub_page = {
  44. content: {
  45. //and so on
  46. }
  47. }
  48. /*
  49. the second would allow to easily get the content of every single page, sub and subsubpage,
  50. whilst the first one is more beautiful in my eyes.
  51.  
  52. which one should i prefer?
  53. */
Add Comment
Please, Sign In to add comment