Skip to content

M8-S2 — A home page and a printable ticket

Section titled “M8-S2 — A home page and a printable ticket”
ModuleM8 — Screens for every audience
After this session you canBuild a home page that shows each person what concerns them, and give people a formatted document from a record.
TimeFacilitated: 48 min · On your own: 48 min
Before you startM8-S1. A text editor on your computer (Notepad or similar). From ACP: M7-S1, where you built Task Home.
Go deeperPages & widgets · Export templates

◆ Orientation (1 min) — One place to start, one thing to keep

Section titled “◆ Orientation (1 min) — One place to start, one thing to keep”

People now have several screens. A home page gathers them, and shows the chart only to the staff. Customers, for their part, ask for a copy of a solved ticket they can keep or forward: a PDF made from a template. Both build on what you know: the page on ACP’s Task Home, the template on the export you used in ACP.

▤ Concept (3 min) — The grid, visibility, and templates

Section titled “▤ Concept (3 min) — The grid, visibility, and templates”

In ACP you built Task Home with a Text and a View widget, marked it Default Page and published it. Three things are new here:

  • Width. Widgets sit on a 12-column grid. With Edit width a widget takes 4, 6, 8 or 12 columns; widgets fill a row left to right, and New row starts a fresh one. An 8-wide list beside a 4-wide chart fills one row.
  • More widgets. Title (a heading), Summary (a chart from a summary: Choose module, Choose entity, Choose summary) and Navigation (a grid of shortcuts to pages, views and reports).
  • Custom Visibility. By default every widget is seen by everyone who can open the page. Under a widget’s General settings, Custom Visibility narrows it to chosen users or groups. A widget can only be narrower than its page.

Each widget still respects access: a View widget shows a person only the records the view gives them. Check the page on a phone with Show preview on the Content tab, which shows your real records in the mobile layout without saving.

An export template is a document with placeholders

Section titled “An export template is a document with placeholders”

An export template is a file you prepare (Word, HTML or Excel) with placeholders where record values go. You upload it to the entity’s Templates tab; people then export a record with it from a view. A Single Entry template makes one document for one record; Multiple Entries makes one for several. For a PDF, upload a .docx or an .html file with Type Pdf.

In an HTML template, {{% … %}} holds logic (a loop over the records) and {{%= … %}} prints a value. entry.value.<identifier> is one field of the record; the identifier is the field’s normalized name, such as ticket_title. Three helpers:

WriteTo get
loc(entry.value.ticket_title)a two-language field in the reader’s language
date(entry.value.start_date, 'dd/MM/yyyy')a date in the format you want
today()today’s date

A Single Entry template can carry a Filter, so it is offered only on records that meet it, and For other entries decides whether others see it greyed out (Disable export option) or not at all (Hide export option).

⛏ Lab (38 min) — Build Support Home and the Ticket summary

Section titled “⛏ Lab (38 min) — Build Support Home and the Ticket summary”

Goal. A published Support Home page, with a staff-only chart; a Ticket summary PDF that customers can export from their closed tickets.

Before you start. Signed in as yourself.

Support Home

  1. Open Customer Support System › Pages › New Page. Name Support Home (Arabic الصفحة الرئيسية للدعم), an icon.
  2. Turn on Pin to Sidebar. Under Access Permissions, turn on Authenticated and Default Page; leave Select Users and Select groups empty.
  3. On Content, add a Title widget, Heading 2, Customer support, width 12.
  4. Add a Text widget: Open a ticket from Ticket Request. We answer within two working days. Width 12.
  5. Add a View widget: Source Ticket Request, Face Table, Count of entries 5. Width 8.
  6. Add a Summary widget: Choose module Customer Support System, Choose entity Support Tickets, Choose summary Ticket Status. Width 4.
  7. In the Summary widget’s General settings, turn on Custom Visibility and choose the group Support Staff.
  8. Add a Navigation widget, width 12, filtered to Data Entity Views and Reports.
  9. Select Show preview: the phone frame stacks the widgets in order. Close it, save the page (Done), and Publish it.

Screenshot pending The Support Home page designer: a table widget 8 columns wide beside the Ticket Status chart 4 columns wide, with the phone preview open What to notice: 8 plus 4 fills one row on the web; on the phone the two widgets stack. The chart’s Custom Visibility is set, so customers will not see it.

The template file

  1. In a text editor, create a file ticket-summary.html with this content, and save it:
<!DOCTYPE html>
<html>
<head><title>Ticket summary</title></head>
<body lang="en-US" dir="ltr">
{{% for(entry of entries){ %}}
<h1>Support ticket {{%=entry.value.ticket_number %}}</h1>
<p><b>Title:</b> {{%=loc(entry.value.ticket_title) %}}</p>
<p><b>Description:</b> {{%=loc(entry.value.ticket_description) %}}</p>
<p><b>Opened on:</b> {{%=date(entry.value.start_date, 'dd/MM/yyyy') %}}</p>
<p>Printed on {{%=date(today(), 'dd/MM/yyyy') %}}</p>
{{% }; %}}
</body>
</html>
  1. Check each identifier: in the Support Tickets designer, open each field’s settings and compare its normalized name with the file (ticket_number, ticket_title, ticket_description, start_date). Correct the file if one differs.

The template on the entity

  1. Open Support Tickets › Templates › New Template (or Add Template). Name Ticket summary, Level Single Entry, Type Pdf, File › Choose file ticket-summary.html, Export Type UI Export.
  2. Under Filter, choose the saved query Closed tickets; For other entries Hide export option. Select Save.
  3. Edit Ticket Request. In the entry-details settings, under Templates, tick Ticket summary. Save.

Check it

  1. As Customer One, open Support Home: the welcome, your tickets and the shortcuts; no chart.
  2. Open your closed ticket Software installation in Ticket Request and export it with Ticket summary: a PDF with its number, title, description and dates downloads. Open an open ticket: the template is not offered.
  3. As Support Manager, open Support Home: the chart is there.

Check.

  • Support Home is published, pinned, the default page, with five widgets in two rows plus the navigation.
  • The Ticket Status widget is visible to Support Staff only.
  • Ticket summary is a Single Entry Pdf template filtered by Closed tickets.
  • Customer One exported a PDF of a closed ticket, and was not offered it on an open one.
  • Support Manager sees the chart on Support Home.

Pass condition. Customer One lands on a home page without the chart and can download a PDF summary of a closed ticket only.

If something goes wrong

What you seeWhat to do
A value is blank in the PDFThe identifier in the file differs from the field’s normalized name, or the view does not display that field.
The template is not offered in Ticket RequestTick it under Templates in the entry-details settings; a Single Entry template appears on a record, not on the list.
A PDF template produces no fileUpload a .html (or .docx) file with Type Pdf.
Customer One sees the chartCustom Visibility is off on the Summary widget, or set to everyone.
You cannot tick Default PageUsers or groups are picked on the page; clear them.
The title shows [object Object] or both languagesWrap two-language fields in loc(…).
Model answer

What you built:

  • Support Home: a 12-wide title and text, an 8-wide View widget beside a 4-wide chart, and a 12-wide navigation grid; default page for everyone signed in; the chart limited by Custom Visibility to Support Staff. Customers’ View widget shows only their own tickets, because Ticket Request uses My tickets.
  • Ticket summary: an HTML file whose loop prints each record’s fields through their normalized names, with loc() for two-language text and date() for dates; uploaded as a Single Entry Pdf template, offered only on closed tickets, and ticked in Ticket Request’s details.

✓ Practice (5 min) — Check your understanding

Section titled “✓ Practice (5 min) — Check your understanding”
PracticeChoose one answer.

On a page open to everyone signed in, a manager wants a chart that only managers see. What do you do?

  1. Explanation for A

    ✗ Incorrect

    Not this one: then nobody else could open the page, and it could no longer be the default page. See What is new since Task Home.

  2. Explanation for B

    ✓ Correct

    Correct: a widget can be narrower than its page, so everyone keeps the page and only managers see the chart. See What is new since Task Home.

  3. Explanation for C

    ✗ Incorrect

    Not this one: a summary has no audience setting of its own; visibility is set on the widget. See What is new since Task Home.

Check your answer

The correct answer is B. Open the explanation under each option to see why.

PracticeChoose one answer.

Three widgets have the widths 6, 8 and 4, in that order, with no New row. How are they laid out on the web?

  1. Explanation for A

    ✗ Incorrect

    Not this one: 6 + 8 + 4 is 18 columns, more than the grid’s 12. See What is new since Task Home.

  2. Explanation for B

    ✓ Correct

    Correct: widgets fill rows left to right, and the 8 does not fit beside the 6. See What is new since Task Home.

  3. Explanation for C

    ✗ Incorrect

    Not this one: the 8 and the 4 together make exactly 12, so they share a row. See What is new since Task Home.

Check your answer

The correct answer is B. Open the explanation under each option to see why.

PracticeChoose one answer.

A template prints Ticket title as both languages run together. What fixes it?

  1. Explanation for A

    ✗ Incorrect

    Not this one: that is a breaking change and loses the second language; the template can handle it. See An export template is a document with placeholders.

  2. Explanation for B

    ✓ Correct

    Correct: loc() picks the text in the reader’s language from a two-language value. See An export template is a document with placeholders.

  3. Explanation for C

    ✗ Incorrect

    Not this one: the level decides how many records go in one document, not the language. See An export template is a document with placeholders.

Check your answer

The correct answer is B. Open the explanation under each option to see why.

PracticeDecide whether the statement is true or false.

With Hide export option, a customer opening an open ticket does not see Ticket summary at all.

  1. Explanation for A

    ✓ Correct

    Correct: records that do not meet the template’s filter do not list it when Hide export option is chosen. See An export template is a document with placeholders.

  2. Explanation for B

    ✗ Incorrect

    Hide export option removes the template from records outside the filter; Disable would show it greyed out. See An export template is a document with placeholders.

Check your answer

The correct answer is A (True). Open the explanation under each option to see why.

You laid out a home page on the grid with a staff-only chart, checked it on a phone, and wrote a template that turns a closed ticket into a PDF. After Module 8 you can design the screens, pages and documents of an application for each of its audiences.

Next. One audience is still missing: colleagues who need something from the support team. In Module 9 you publish a service in the catalog, with an approval by the requester’s own manager.