Sign Up

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 interaction or external inputs.

  • Dynamic Content: The capability of a page to change its displayed information based on the values of query parameters.

Main Components and Workflow

  1. Text Elements: Text fields can be dynamically updated with content derived from query parameters by embedding special syntax, which includes a dollar sign and double curly braces (e.g., {{$query.name}}). This syntax allows real-time data binding to URL parameters.

  2. Page Publishing: Once changes are made and content is set using query parameters, publishing the page enables public access, demonstrating the dynamic text updates with actual query values in the URL (e.g., ?name=twidget).

  3. Visibility and Other Settings: Query parameters can also be utilized in various element configurations, such as visibility settings, where they help tailor the user interface based on incoming data. These parameters appear in the variable dropdown during configuration, making them easily accessible.

  4. Functions: In addition to visual elements, query parameters can be accessed within page functions. Functions can be created to execute specific logic using query parameter values. For instance, a logging function can be implemented to track the values of the query parameters by referencing the query object (e.g., $query.name).

Overall, Twidget empowers users to create dynamic and responsive web pages that adapt based on the query parameters within the URL, greatly enhancing the interactive capabilities of web applications.

Related Topics

Upload a File using Pages

This documentation describes the functionality available in Twidget for uploading files through a generated API endpoint and managing interactions via pages. The process allows developers to create dynamic forms that enable users to upload files directly to the backend file storage, specifying vario...

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 ...

Generating Form Pages

Generating form pages in Twidget enables the automatic creation of user input forms that can be utilized for various purposes such as lead generation, customer information retrieval, and interactive message boards. This functionality allows developers to directly map user inputs to form objects, whi...

reCAPTCHA

Twidget integrates Google's reCAPTCHA, a security service designed to protect websites from spam and abuse by distinguishing between human and automated access. reCAPTCHA operates by requiring users to complete simple tasks, such as identifying objects in images or clicking a checkbox, thereby provi...

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...