Skip to main content

Bindings, Variables & Functions

Bindings put live values into your content. Instead of hard-coding text, you reference a variable, a function result, or a dataset field, and Aglyn resolves it when the page renders.

Plan availability

Free to start, with plan caps on the number of variables, functions, and workflows.

The Logic page: variables and functions that bindings resolve

Binding tokens​

Bindings appear inside text props as tokens:

TokenResolves to
{{name}}A site variable.
{{fn:name(args)}}The result of a function.
Dataset field bindingsA value from a dataset record.

The Besigner resolves bindings WYSIWYG on the canvas and marks bound content so you can see what's dynamic. That includes the shared layout around a page, and the inside of a placed component or form, which show the same values the published page shows. The { } button in the canvas toolbar switches to the raw tokens and back.

Rename-safe id tokens​

Bindings reference variables and functions by id, not by name. That means renaming a variable doesn't break anything that uses it. A typed {{name}} is converted to its id form when you save or publish, wherever you typed it: an attribute field, the canvas, Raw JSON, or an element's Edit JSON. Imports are converted automatically. The conversion happens on the canvas too, as one step that Undo takes back. A published page resolves only the id form, so a name token that was never converted — because no variable had that name — shows exactly as typed.

Insert a variable​

You never have to hand-type token syntax. Every text-capable attribute field in the Besigner (Text, Link URL, Image URL, …) has a small {x} insert button at its end. Click it to open the data picker — a searchable menu grouped by source:

GroupTokensWhen it appears
VariablesYour site variables (inserted as rename-safe id tokens)When the site has variables
FunctionsYour functions, with parameter placeholdersWhen the site has functions
SiteThe site's own details — see Site detailsAlways
EntryCollection-entry fields — Title, Excerpt, Link URL, Published date, …Always (hint shows where they resolve)
CollectionCollection name and slugAlways (resolves on collection pages)
Dataset itemThe fields of the repeated dataset, by display nameOnly inside a repeating container

Picking an option inserts the token at your cursor, keeping the text around it — so you can compose values like Read “{{entry.title}}” → or https://example.com/blog/{{entry.slug}} by mixing typed text and inserted placeholders. Pick again to keep concatenating; the cursor lands right after each inserted token. Each variable option shows a live value preview so you can confirm what the binding resolves to before inserting it.

Selected text is replaced by the inserted token, and the element-level Insert binding button on text elements opens the same picker (appending to the element text).

Token pills​

Placeholders never show up as raw {{...}} syntax while you edit — each one renders as a small colored pill carrying the binding's current display name. Variables, functions, entry fields, collection fields, and dataset items each get their own stable color, so a glance tells you what kind of data a pill resolves to. Under the hood the stored value still keeps the rename-safe id token: the pill is pure presentation, which is why renaming a variable instantly relabels every pill without touching your content.

  • Click a pill to act on it: Replace reopens the data picker and swaps the token in place, Remove deletes it from the text.
  • A pill whose referent no longer exists (a deleted variable, an unknown token) renders in a warning color, with the raw token as its tooltip.
  • Typing raw {{...}} by hand still works — the token becomes a pill when the field loses focus.

In the canvas text editor​

Double-clicking a text element opens the inline text editor right on the canvas — and it speaks pills too. Existing tokens render as pills the moment the editor opens, the toolbar's {x} button opens the same grouped data picker (with the element's own context: dataset items inside repeating containers, entry fields inside Collection entries blocks), and clicking a pill offers the same Replace/Remove. Rich-text elements keep their formatting toolbar — pills sit inline with bold, italic, links, and lists, and everything serializes back to plain token syntax when the edit commits.

Advanced: type it raw

The picker is a convenience, not a requirement — typing {{...}} tokens by hand keeps working everywhere, and typed {{name}} tokens are normalized to rename-safe id form on save.

Everywhere else the console references logic by entity, it uses pickers that store ids, never typed names: workflow steps pick their function, automations pick their workflow/dataset/webhook, and computed variables pick their workflow. Renaming an entity never breaks anything that references it — the display name is just a label.

Site details​

{{host.*}} tokens name the site itself instead of hard-coding it, so copy stays right when the site is renamed, and a template installed on another site fills in that site's details.

TokenFills in
{{host.businessName}}Business name, from Setup → Business profile → Business details, or the site name when that is empty
{{host.slogan}}Slogan, from the same card
{{host.logo}}The site's logo, from Setup → Basic details → Site logo
{{host.logoDark}}The site's dark mode logo from the same card, or its logo when it has no dark one
{{host.url}}The site's address — its custom domain when one is connected
{{host.phone}}Phone, from Setup → Business profile → Business details, as you typed it
{{host.phoneLink}}The same phone as a link that dials it, such as tel:+15125550100, for a Call button
{{host.supportEmail}}Email, from the same card
{{host.address}}The postal address from the same card, on one line
{{host.mainArea}}The first of Areas served, from Setup → SEO → Local business, by its place name: San Antonio for "San Antonio, TX"
{{host.areasServed}}Every one of Areas served, in order, separated by commas
{{host.socialLinks}}The labels of the card's Social links
{{host.facebookUrl}}The address of the site's Facebook profile, from its Social links
{{host.instagramUrl}}Its Instagram profile
{{host.xUrl}}Its X profile, on x.com or twitter.com
{{host.linkedinUrl}}Its LinkedIn profile
{{host.youtubeUrl}}Its YouTube channel
{{host.tiktokUrl}}Its TikTok profile

Each social link variable finds its profile by the link's address, not its label, so a link labeled anything at all still counts.

The links work in a button's or a link's External URL: pick Phone link from the variable picker there and the button dials your number, or Instagram link and it opens your profile. Change the number or the profile in Business details and every page that uses it follows, with no variable of your own to keep up to date.

A detail the site hasn't set renders as nothing, never as the token. The canvas and Preview fill these in from the site you are editing, exactly as the published page does. In a field, the token shows as a pill named after the detail, such as Business name.

Typed variables​

Create typed site variables and reference them as {{name}} in any prop. Types keep values consistent across the site.

A Dictionary variable holds named entries — one plan's name, annual price and number of sites, say. Its editor is a table: press Add entry, give the entry an Entry name, pick its Type (Text, Number or True/false) and fill in the Value. A Collection list works the same way without names: Add item adds the next value in the list, and × removes one. On a page, a bare {{name}} shows a dictionary as name: value pairs and a list comma-separated.

No-code functions​

Build functions in the in-editor function builder with a safe evaluator — no arbitrary code execution. Compose variables and other functions, and call them inline with {{fn:name(args)}}.

A function is parameters in, numbered if / then / otherwise steps, and one value out. Each box in a step has an ƒx button beside it. Press it, choose what to Work out, and pick the values it works on — a parameter, one of the function's own variables, a site variable, a number or some text — then press Use formula:

Work outWhat it does
Use a valueOne value as it is
Add, Subtract, Multiply, DivideArithmetic on two or more values (Add another for more)
Smallest of, Largest ofThe lowest or highest of the values
Round, Round down, Round upRounds to the Decimal places you pick, or to a whole number
Without its minus signThe value as a positive number
Format as moneyThe amount with a currency Sign and thousands separators — 1396 reads $1,396.00
Format with thousands separators1234567 reads 1,234,567
Join textPuts texts together with a space, a comma, a dash or nothing Between each

The dialog shows what the box will read before you use it. When the box already holds a formula, What is there now offers it as a value, so you can build on it — add two prices, then Format as money with the sum.

What a formula can read:

  • Any site variable, by its name. A function that prices a plan can read extra_site_price directly, so changing the variable changes every page and every calculator that uses it. A function can read a variable and never set one, and a parameter or local variable with the same name wins.
  • A dictionary variable's entries. Keep one dictionary per plan and the ƒx picker lists each entry under the variable — plan_pro → annual. A text variable inside the function can hold a copy of one (set it to plan_pro), so the function can pick a plan and then read that plan's entries.

There are no loops and no way to add a built-in, which is what keeps the evaluator safe to run on a page.

Advanced: type it raw

A box also takes a formula written out, the same way the ƒx dialog writes it: + - * / and parentheses, names as plan_pro.annual, and the built-ins min, max, round, floor, ceil, abs and format. Nothing needs it — every formula above is built by picking.

Create with AI on the Functions and Variables cards writes one from a description, and a saved function's editor can explain, change or fix it — each opens unsaved in the editor. See Functions and variables with AI.

The Functions card​

The Functions card on a site's Logic page lists every function the site has, each with its parameters and the value it returns — press Add function to build one, or Edit to change it. Usage finds where a function is used before you change it, and Delete removes it. Your plan sets how many functions a site can have; at the limit, Add function says so and points you to Billing.

In the builder, give the function a name, its Parameters, any Variables it works with, and its Operations — numbered steps with Then do this and Otherwise do this branches — then pick the value it returns.

Parameters a visitor can answer​

When a function is placed on a page in a Function Widget, each parameter becomes an input. Under What visitors see in the function builder, give a parameter a Label (instead of its identifier) and a value it Starts as. To ask it as a list, press Add choice once per answer: Function gets is the value the function receives, and Visitors see is the wording on the list (the value itself when left blank). × removes a choice. Once a parameter has choices, Starts as is picked from them; a true/false parameter starts On or Off. A parameter with choices is asked as a list, a number as a number box, and a true/false as a switch.

A widget runs in the visitor's browser, so the function's definition is part of the page, along with the site variables that function names — and only those. Do not put anything in a function, or in a variable a widget's function reads, that a visitor should not be able to see.

A calculator you lay out​

A Function Widget draws a whole calculator for you: the inputs in a row, a button, the result. When the design is yours — a number box with quick picks beside it, two questions asked as lists, a table whose rows a filter removes, one row highlighted, a sentence under it — build it from four elements instead, all under Input in the Elements panel. They, and the Function Widget, come from the Calculators plugin, installed from the marketplace:

  1. Place a Calculator and give it the function's name. It is an ordinary container.
  2. Inside it, place a Calculator Input for each question and name the parameter it asks. Two inputs may ask the same parameter, and they stay in step.
  3. Place a Calculator Result wherever a value belongs and name the parameter or variable it shows. Style it like any text.
  4. Wrap anything that should appear only some of the time in a Show When and name the value that decides it.

The function does the arithmetic and decides what shows: give it a local variable for every figure on the page, and a true/false for every row a filter can turn off. The layout between those elements is whatever you build.

Where-used & safety​

Before you rename or delete a variable or function, run the where-used scan to see every page and prop that references it, so changes are safe.

Workflows​

Variables and functions compose into workflows — multi-step logic triggered by site events. See Workflows & actions.