Part 8 - Creating the category homepage using Reporting

Overview

Create a homepage for each category to list all the articles available in that category.

Link to Add New Article (optional)

  • insert an add-page macro from our Linking app

  • edit the add-page macro

Name can be left blank if you do not wish to add a default page title.

  • enter the name of the link in Link Text

  • enter the name of the template you wish to render in Source

Remember to check Live Template so that the new page renders a live-template block!

  • enter the name of the labels you wish to attach to the new page in Labels

Creating the Article Listing

  • enter a title for the listing

    • for example, 'List of articles labeled under...'

  • insert a report-info block to display the title of the article

The title is also the name of the label.

  • edit the report-info block

    • enter content:title in Key

  • insert a report-list block

In the report-list block

  • insert a local-reporter and report-body block

  • edit the local-reporter block

    • enter content:children in Key

Inside the local-reporter block

  • insert a date-sort block

  • edit the date-sort block

    • enter content:modification date in Key

In the report-body block

  • insert three report-info blocks

    • for the first report-info block

      • enter content:title in Key

      • check Link To Item

    • for the second report-info block

      • enter content:modification date in Key

    • For the third report-info block

      • enter content:modifier in Key

      • check Link To Item

This layout can be used continuously across different categories, you just have to change the label and template source in the add-page macro.

Understanding the Reporting structure

Code

<p class="auto-cursor-target"> <ac:structured-macro ac:macro-id="e5bd2965-4f64-4476-8cfa-901eafe45a5a" ac:name="add-page" ac:schema-version="1"> <ac:parameter ac:name="linkText">Add a new article to this category</ac:parameter> <ac:parameter ac:name="source">KB how to article</ac:parameter> <ac:parameter ac:name="live">true</ac:parameter> <ac:parameter ac:name="labels">how-to</ac:parameter> </ac:structured-macro> </p> <p> </p> <p>List of articles labeled under <ac:structured-macro ac:macro-id="ba9381db-531b-407b-8ed3-c251881c0793" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="">content:title</ac:parameter> </ac:structured-macro>: </p> <ac:structured-macro ac:macro-id="25daa117-a072-42de-be4f-7c2ef960df74" ac:name="report-list" ac:schema-version="1"> <ac:parameter ac:name="depth">all</ac:parameter> <ac:rich-text-body> <ac:structured-macro ac:macro-id="09e7c568-e8e2-4263-9618-66c3cbd9c642" ac:name="local-reporter" ac:schema-version="1"> <ac:parameter ac:name="">content:children</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="b5470301-df2f-47de-850b-eaa8bf5a4910" ac:name="date-sort" ac:schema-version="1"> <ac:parameter ac:name="order">descending</ac:parameter> <ac:parameter ac:name="">content:modification date</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="ee457283-cd1e-4f9b-9853-8f9c4b288b06" ac:name="report-body" ac:schema-version="1"> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="660b326e-e8f3-452c-8019-9796090375b0" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="link">true</ac:parameter> <ac:parameter ac:name="">content:title</ac:parameter> </ac:structured-macro> (Last modified on <ac:structured-macro ac:macro-id="110afde8-7b82-40cc-ab7b-9b05615ba2bc" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="">content:modification date</ac:parameter> </ac:structured-macro> by <ac:structured-macro ac:macro-id="8fec56c8-b56f-4079-8833-123cc894b6c4" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="link">true</ac:parameter> <ac:parameter ac:name="">content:modifier</ac:parameter> </ac:structured-macro>)</p> </ac:rich-text-body> </ac:structured-macro> </ac:rich-text-body> </ac:structured-macro>