tutorial04.rst 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. Tutorial Part 4: Creating a Blog
  2. ================================
  3. We want to add a blog to our site, so let's get some practice with Article Pages!
  4. Then we will get some practice building a basic web page as well.
  5. Adding articles to the site
  6. ---------------------------
  7. Okay, Articles will be child pages (also known as sub-pages) for the **Article Landing Page**. This
  8. is important to remember because sub-pages can be accessed by the parent page (also known as the
  9. landing page).
  10. .. note::
  11. Before we can add any Articles, we have to create the Article Landing Page.
  12. Click on **Pages > Home** to get to the screen that will allow you to create child pages under the Home page.
  13. It looks like this:
  14. .. figure:: img/tutorial_home_child_edit1.png
  15. :alt: Screen for adding pages under the Home page.
  16. The admin screen for adding pages under the Home page.
  17. Click on the button that says **Add Child Page**. Because we are still using the built-in page types, you should
  18. only see three types of pages available for now:
  19. * **Article Landing Page** - The landing page for articles, blog posts, etc.
  20. * **Form** - A page type for building forms.
  21. * **Web Page** - A basic page type for building any type of web page.
  22. .. figure:: img/tutorial_home_child_edit2.png
  23. :alt: Screen for Home page sub-page types.
  24. The admin screen for choosing sub-page types under the Home page.
  25. Select the **Article Landing Page** to begin. For now, we will keep this particular page simple.
  26. Just give it a title of Blog. Add a cover image if you would like one. Now **Publish** it. We will
  27. come back to it later on in this tutorial.
  28. Go back to the admin screen for adding pages under the Home page. You should now see the Article Landing
  29. Page listed that we named Blog. Hover over it to reveal more options for Blog, and you should see the options
  30. to add child pages to the Blog page. We want to add a few posts, so select **Add Child Page**. This will
  31. take you to the Article page type for editing!
  32. .. figure:: img/tutorial_blank_article.png
  33. :alt: A fresh article page in edit mode.
  34. The edit screen for a fresh article page.
  35. The anatomy of an Article Page
  36. ------------------------------
  37. The Article Page has several built-in fields to make it easy to publish an article, or blog as in our
  38. case. We will want to fill in the following:
  39. * **Title** - Title of the article or blog
  40. * **Cover Image** - Not required but can add interest to your page
  41. * **Caption** - The sub-title for the article or blog
  42. * **Publication Info** - Here we add the author, the display name for the author if different, and the Publication date
  43. * **Body** - Content for our article or blog
  44. Let's write a short blog about the story of our cupcakes. Once we fill in the information we want to add above, we
  45. can select what we want to add to the body of the blog post. We will choose a **Text** block.
  46. After we add our Content in the Text block, we can add other types of content if we like. How about a button?
  47. Select the + sign under the Text block, then choose **Button Link**. Continue to add different content blocks
  48. as you see fit for the blog post.
  49. .. figure:: img/tutorial_blog_post_edit.png
  50. :alt: The edit screen for our first blog post.
  51. The edit screen for our first blog post.
  52. Now publish it and see what it looks like! This is what our blog post looks like:
  53. .. figure:: img/tutorial_blog_post_published.png
  54. :alt: Our first published blog post.
  55. Our first published blog post.
  56. Add a few more blog posts to get some practice, then we will return to our Blog landing page.
  57. Completing our Blog landing page
  58. --------------------------------
  59. On the admin page, we can select to edit the main Blog page. Click the **Edit** button that is under the
  60. word **Blog**. Alternatively, you can find the Blog page in the Home page admin view or by clicking on Pages.
  61. .. figure:: img/tutorial_blog_admin_view.png
  62. :alt: Admin view to edit our pages.
  63. The admin view to edit our blog posts and our Blog landing page.
  64. Just like on the other pages, we can add a cover image and build the layout. Let's do that! We will use
  65. Responsive Grid Row and just one full-width column for an introduction. Then we will show you the different
  66. ways to display your sub-pages on the landing page.
  67. .. figure:: img/tutorial_blog_landing_edit1.png
  68. :alt: The edit screen showing our intro on Blog page
  69. The edit screen showing the introduction on our Blog landing page.
  70. Publish and see what happens!
  71. .. figure:: img/tutorial_blog_landing_published.png
  72. :alt: Our published Blog page
  73. The published Blog landing page.
  74. Whoa! The blog posts are already showing up! What is this magic? Well, remember that this is a parent page type
  75. and the blog posts were children of this page. The option to "show children" is already pre-selected in the edit mode
  76. for the landing pages. We should go take a look at that now.
  77. Ways to display sub-pages on a landing page
  78. -------------------------------------------
  79. Go back into the editor for the Blog landing page. You should see the following tabs at the top:
  80. * **Content**
  81. * **Classify**
  82. * **Layout**
  83. * **SEO**
  84. * **Settings**
  85. We want the **Layout** tab. Click on that tab and you'll see something like this:
  86. .. figure:: img/tutorial_blog_landing_layout_tab.png
  87. :alt: The Layout tab for the Blog landing page
  88. The Layout tab for the Blog landing page.
  89. We are using the default template, so skip over that for now. The sections titled
  90. **"Show Child Pages"** and **"Child Page Display"** contain the settings for whether or not
  91. the sub-pages (blogs in this case) are automatically pulled onto the page, how many
  92. of them to show, and what fields or pieces of them to show as a preview.
  93. .. note::
  94. The "Show Child Pages" setting in Layout is the simplest and easiest way to display
  95. your sub-pages on a landing page.
  96. But we said that there are other ways to do this! Well, yes, there are. De-select "Show Child Pages"
  97. in Layout so that we can try the other way of displaying your sub-pages. Then go back to the Content area.
  98. You can add more content below the Text block with our introduction, or make a new column for content, or start
  99. a new Responsive Grid Row to add a column with content.
  100. What we want to look at is the **Latest Pages** block. The Latest Pages block is extra powerful because you can access
  101. the sub-pages of **any landing page on the site**! You can look at it for now, but we are going to just use the "Show Child Pages"
  102. in Layout after all. We will go into more depth about this block and other content blocks in the future.
  103. Remember to re-select "Show Child Pages" in Layout before publishing it.