Sign Up
Loading...

On this page

Page List Loop

The Page List Loop Element in Twidget is a powerful feature designed to enable dynamic repetition of UI elements based on a data source. By utilizing this component, developers can create interfaces that automatically display lists of content, allowing for more interactive and data-driven applications without requiring extensive coding.

-

Core Concepts

  • Iteration: The List Loop Element repeats all its contained elements for each item in the specified data source, resulting in a seamless rendering of multiple items.

  • Variables: Within the loop, two automatic variables are created:

    • Item Variable: This variable corresponds to the individual items within the data source and provides direct access to their properties.

    • Index Variable: This variable represents the current position of the item in the data source array, enabling developers to customize the output based on the item's index.

Data Source Requirements

For the List Loop Element to function, a valid data source must be assigned. This can either be a reference to an existing variable or a newly created variable that holds a list of data items. The content of the List Loop will then adjust dynamically based on the number of items present in the data source.

Example Implementation

When implementing a List Loop on a page, developers can:

  • Define a new list variable (e.g., containing three elements) to serve as the data source.

  • Populate UI elements inside the loop with content that references the Item and Index variables.

  • Update the design in the editor to see the structural layout prior to going live.

Dynamic Data Representation

Once the page with a List Loop is created and connected to a data source, users can preview the page to see each element rendered according to the list items. The text elements can reflect both the index and the item's associated content, showing how data binding works in practice:

  • Each UI component inside the loop displays content relevant to its corresponding item, effectively demonstrating the dynamic capabilities of the List Loop Element.

Summary

The Page List Loop Element enhances Twidget’s utility by providing the means to easily generate dynamic lists from data sources, utilizing item and index variables. This facilitates the creation of responsive and data-driven user interfaces while minimizing the need for extensive coding.

Related Topics

Access Query Parameters in a Page

This section details how to access and utilize query parameters within Twidget pages, enabling dynamic content and functionality based on user-supplied parameters. Key Concepts. - Query Parameters: A method to pass data to web pages through the URL, enabling dynamic content updates based on user int...

Page Layouts

Page layouts in Twidget provide a structured way to organize and present content on a web page. The primary purpose of page layouts is to enhance user experience through effective content management and visual hierarchies. Key Concepts. - Header & Sidebar Layouts: These layouts subdivide the page in...

Element States

Element states are fundamental attributes that define how elements visually respond to user interactions within the Twidget no-code API platform. Each element, such as buttons, input fields, or cards, can exist in multiple states, each with unique visual characteristics that enhance the user experie...

Data Source Mappers

Data Source Mappers are essential components within the Twidget no-code API platform, designed to facilitate the integration of dynamic data sources with UI elements. They serve the purpose of linking data source attributes to the respective fields required by UI components such as dropdowns, radio ...

Page Settings

The Page Settings feature allows users to customize various aspects of their web pages, particularly in relation to branding, security, and domain management. This functionality enhances the user experience by allowing for personalization and integration of essential web components. - Favicon: A fav...