Skip to content
Help Center
Submit a request Sign in

Liquid forum topic lists: loop through sb.forum correctly

Inside a community area, customers need to recognize the discussion that matches their question. sb.forum supplies the topic rows for the selected forum. Despite its singular name, it is a collection, so a template must loop through it before reading a title or other row property.

At a glance

For: portal administrators and designers working with support operations. Applies to: Supportbench Core.

Start here: Settings → Customer Portal → select the portal → Page templates

What this object gives you  ·  Choose the correct page and customer context  ·  Supported values and how to use them  ·  Example: help customers choose a relevant discussion  ·  Use discussion status without overstating the answer  ·  Make and verify the change  ·  Common problems and recovery  ·  Keep the portal useful over time

What this object gives you

Use {% for discussion in sb.forum %} and then read discussion.title. An expression such as sb.forum.title treats the collection as one discussion and is not the correct Core pattern.

These rows summarize discussions. Open the topic route to display the actual posts. A resolved marker helps readers spot a potentially useful outcome, but they still need to read the discussion and check whether it applies to their own situation.

Choose the correct page and customer context

Use a forum page with a valid selected ForumId and its normal paging context. A general forum directory uses sb.forums instead. A single discussion page uses sb.topic.

Open the intended portal in Settings → Customer Portal, then choose Page templates. You need permission to administer communities or the applicable portal-edit override. Work on the existing page for this task; adding an object name to a different page does not make its records available. Keep existing forms, input names, navigation and scripts intact.

Liquid is a presentation language. Expressions inside {{ ... }} print values; statements inside {% ... %} control a loop or condition. A collection must be looped through before reading an individual row. These examples are display fragments to adapt within a working template, not replacement page templates.

Supported values and how to use them

MemberMeaning and operational use
id / titleDiscussion identity and title, not the enclosing forum’s identity and name.
resolvedBoolean indicating the discussion’s resolved state.
vote_count / post_count / view_countInteger counts. Describe them accurately; views are not unique organizations or confirmed successful resolutions.
last_post_on / last_post_by / avatarOptional last-post date, author name and avatar.
created / modifiedCreation and modification dates. Creation is not the same as last modification.

Example: help customers choose a relevant discussion

<ul class="discussion-list">
{% for discussion in sb.forum %}
 <li>
 <a href="/topic/{{ discussion.id | escape }}">{{ discussion.title | escape_once }}</a>
 {% if discussion.resolved %}<span>Resolved</span>{% endif %}
 <span>{{ discussion.post_count }} posts</span>
 </li>
{% else %}
 <li>No discussions are available in this forum context.</li>
{% endfor %}
</ul>

Keep the portal’s existing paging and filtering controls. A Liquid loop only displays the rows supplied for the page; it is not a request for every discussion in the entire community. Use clear link text so a keyboard or screen-reader user can distinguish the discussions.

Use discussion status without overstating the answer

A customer investigating an intermittent pump alarm may find several similar titles. A title naming the equipment and symptom, combined with a resolved indicator, helps them select a promising discussion. It does not establish that the posted solution is approved for every model.

When a discussion exposes a reusable answer, the support team can review it through the knowledge process and publish an appropriately scoped article. Preserve the distinction between a community conversation and a reviewed instruction.

Make and verify the change

  1. Write down the customer task this change should improve. For example, make the correct request or relevant knowledge easier to find. Decide what should appear when there is no data.
  2. Copy the current template into your approved change record before editing. Add the fragment in the correct page context without removing functional controls.
  3. Choose Save Changes to save the draft, then Design to preview it. Check a populated example and an empty or signed-out example as applicable.
  4. Inspect desktop and narrow-screen layouts. Test long customer names, long titles, missing optional values, readable links and keyboard navigation.
  5. Use Review changes → Publish when the draft is ready. A saved draft does not update the live visitor page.
  6. Open the actual portal as an intended customer and follow the full task. Verify another relevant role or customer scope where visibility differs. Record the account, page, role and outcome with the change.

Preview is only part of the check

Designer examples use synthetic data. They can show layout and syntax problems, but do not prove that a real customer has access to a record. Keep portal access rules and the actual customer test separate from visual preview.

Common problems and recovery

ProblemWhat to check
sb.forum.title is blankLoop through sb.forum and read the title on each row.
The list is shorter than expectedCheck the current forum and paging context. A display loop does not bypass paging or access scope.
Created and modified show the same labelUse distinct labels or show only the date the customer needs.
Resolved is treated as a support guaranteeExplain it as the discussion’s state, then direct the reader to evaluate the answer and its applicability.
The template renders in preview but the live page has not changedConfirm that you published the reviewed draft for the correct portal, page and language. Reopen the live page.
A customer sees fewer records than an agentCheck the customer’s portal role, company/contact relationship and the record’s audience. Do not attempt to broaden access by changing a Liquid loop.
A layout change breaks a form or navigationCompare the changed template with the saved working version. Restore missing form IDs, inputs, URL patterns or callbacks before publishing the corrected draft.

Keep the portal useful over time

Encourage descriptive discussion titles and keep reviewed knowledge easy to reach from community navigation. Do not use activity counts as a substitute for answer quality or customer impact.

Use clear labels and meaningful empty states. Do not display a raw ID when a customer needs a descriptive name, and do not describe an absent value as a service failure. After changes to portal roles, topic placement, custom fields or language coverage, revisit the relevant customer examples. A successful render alone does not establish that the instructions, links and customer visibility are still correct.

Was this article helpful?