tutorial07.rst 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. Tutorial Part 7: Create Categories with Classifiers
  2. ===================================================
  3. Now we actually want to go back to our blog posts and organize them. We can do
  4. that by adding **Classifiers** to our pages so that we can access them via their
  5. category.
  6. What are Classifiers?
  7. ---------------------
  8. Classifiers are essentially categories that you give to an item. For our pharmaceutical company,
  9. classifiers that we might use could be something like:
  10. * **Vaccines:** Covid-19, Chickenpox, Tetanus, Monkeypox etc.
  11. * **Types of health issues:** Cancers, Autoimmune, Heart Disease, Diabetes, etc.
  12. * **Types of content:** News, Press, Interviews, FAQs, etc.
  13. Adding Classifiers in the CMS
  14. -----------------------------
  15. You can start adding Classifiers by going to **Snippets > Classifiers**. Select that you want to add a new
  16. Classifier, and you would do this for each Classifier that you want to add.
  17. For the purposes of this tutorial, we are going to add a Content Types classifier and a Vaccines
  18. classifier.
  19. .. figure:: images/tut07/new_classifiers.jpeg
  20. :alt: Screen for adding a new Classifier.
  21. The admin screen for adding a new Classifier.
  22. The first Classifier we are adding will be for Vaccines. For Name, we would put Vaccines because this is the
  23. generalized heading for the category. Then we would click the **Add Classifier Terms** button to begin adding the
  24. sub-categories below that main term.
  25. **Save** and Add more Classifiers for type of health issues and types of content. Here's our editor after those additions:
  26. .. figure:: images/tut07/page_edit_classifiers.jpeg
  27. :alt: The Classifiers that we added.
  28. The edit screen for the Classifiers that we added.
  29. .. note::
  30. We realize that you could decide that you want to add Classifiers in the middle of building your pages.
  31. If you have not already added Classifiers in Snippets, you can click the Classify tab in the page editor and
  32. select that you want to create Classifiers. It will take you to the Snippets editor for Classifiers to do so.
  33. Selecting Classifiers for your pages
  34. ------------------------------------
  35. Okay, now we have some Classifiers to work with. Let's head back to our blog posts and start categorizing them.
  36. In the admin screen **Pages> Home > What's New at CRX-Pharma > Any Article Page** click the pencil to go editing screen. (alternatively, click the title and then edit).
  37. Next click the **Classify** tab and you'll see the classifiers we setup.
  38. .. figure:: images/tut07/page_edit_classifiers.jpeg
  39. :alt: The Classifiers are visible in blog pages now.
  40. The edit screen for the Classifiers that we can choose from in a blog post.
  41. You can choose as many classifiers as you like. For our blog "Oral Vaccines now available", we
  42. are going to choose classifiers Press Release, News, and Covid-19. For the "Cancer Drug Breakthrough" article, we classified it as Cancer, Press Release, and News.
  43. Additionally, we classified the "Now partnered with a great charity" with news and FAQs.
  44. Using Classifiers across the site
  45. ---------------------------------
  46. One of the places where you might use the Classifiers is in a **Latest Pages** content block. For practice and
  47. to see this in action, let's add a Latest Pages to our About Us page. Use the side menu in the admin screen to navigate to **Pages > Home > About Us**.
  48. * Choose **Edit**
  49. * Add a **Responsive Grid Row**
  50. * Choose **Latest Pages**
  51. * In the **Parent Page** Choose "What's New at CRX-Pharma"
  52. * In **Classified by** choose "Types of Content > news"
  53. * **Save draft** and **Preview**
  54. .. figure:: images/tut07/latest_page_block.jpeg
  55. :alt: Editing the Latest Pages content block.
  56. Editing the Latest Pages content block.
  57. .. figure:: images/tut07/news_classifier.jpeg
  58. :alt: About us page with News Classifier selected
  59. About us page with News Classifier selected in latest page block.
  60. Let's make a few changes to see the difference. In the editing screen,
  61. * Change **classified by** to "Health Issues > Cancer"
  62. * Select **Show body preview**
  63. * **Save** and **Preview**
  64. .. figure:: images/tut07/cancer_classifier.jpeg
  65. :alt: About us page with cancer Classifier selected.
  66. About us page with cancer Classifier selected.
  67. Notice that, only pages with the correct classifier show up. If you were to publish a new page with the selected classifier this page will
  68. automatically update with the new post. Take a look at the advanced settings for the latest pages block.
  69. There are different templates you can use for displaying article pages.
  70. Using Classifiers on an Article Landing Page
  71. --------------------------------------------
  72. You can also use Classifiers on an Article Landing Page. If we go to the "What's New at CRX-Pharma" page and look at the **Layout** tab in
  73. editor mode, we can see our Classifiers in the **Show Child Pages** setting. If we only wanted to show press releases for that pages we can select that option.
  74. For now keep it as is.
  75. .. note::
  76. If you're coming from WordPress, you can think of Classifiers as equivalent to WordPress Categories
  77. and Classifier Terms as equivalent to WordPress Taxonomies.
  78. For more info on classifiers, see: :doc:`/features/snippets/classifiers`.
  79. About Us Page Layout
  80. --------------------
  81. For the rest of this section we can just take a few minutes and build out the "About Us" page. This gives us a chance to demonstrate how to add content blocks above
  82. blocks already on the page.
  83. * Find the **Responsive Grid Row** block in the editing screen.
  84. * Click on the "+" icon directly above it. Now we can add a block above the Latest Pages we just setup.
  85. * Choose **Responsive Grid Row** , then **Column**, then 1/2 Column for **Column size**
  86. * Choose **Image link**
  87. * Use **Page link** and select the "Our Facility" page
  88. * Make another 1/2 column
  89. * Choose **Text**
  90. * Make an h2 heading with "Founded in 2013" and some placeholder text underneath.
  91. * Click the "+" directly under the text editor
  92. * Choose "Quote"
  93. * Enter this Albert Einstein quote: "The true sign of intelligence is not knowledge but imagination."
  94. * Directly above the **Latest Pages** block (in the same column) add a **Text** block
  95. * Enter "Current News:" as an H3
  96. * **Save** and **Publish**
  97. .. figure:: images/tut07/about_us_edit1.jpeg
  98. :alt: About Us Page edit screen 1 of 2
  99. About Us Page edit screen 1 of 2
  100. .. figure:: images/tut07/about_us_edit2.jpeg
  101. :alt: About Us Page edit screen 2 of 2
  102. About Us Page edit screen 2 of 2
  103. .. figure:: images/tut07/about_us_preview.jpeg
  104. :alt: About Us Page after editing
  105. About Us Page after editing.
  106. As you can see, you have tons of options when it comes to adding new content.
  107. Sometimes it takes a couple tries to get it right, however with a little practice it becomes second nature.