Timill Platform Documentation

Widget - Simple Item List

Example of a simple item list widget in Timill Platform.

Basic item list with filtering by item type.

Example Code#

<div class="bg-white rounded-lg shadow">
  {{$items := queryItems (printf "type='%s'" .itemType)}}
  <h3 class="text-lg font-semibold p-4 border-b">{{.title}} ({{len $items}})</h3>
  
  <div class="divide-y">
    {{range $items}}
      <div class="p-3 hover:bg-gray-50">
        <div class="flex items-center justify-between">
          <span class="font-medium">{{.Title.Get}}</span>
          <span class="text-sm {{statusColor .Status.Get}}">{{.Status.Get}}</span>
        </div>
      </div>
    {{else}}
      <p class="p-4 text-gray-500">No items found</p>
    {{end}}
  </div>
</div>

Parameters#

ParameterTypeDefaultDescription
itemTypestring"task"Item type to filter by
titlestring"Items"Widget title

Customization#

Change the item type:

{{$items := queryItems (printf "type='%s'" .itemType)}}

Add status filter:

{{$items := queryItems (printf "type='%s' status='%s'" .itemType .status)}}

See also: Scripted Widgets Guide