Page Navigation
Navigation Slugs
In the Appearance > Navigation tab of your site's settings, you can define navigation slugs, which are displayed in the URL of in the user's browser. You'll see more about how the URLs are built later in this page.
The structure of your navigation slugs is a nested JSON object as shown below. The name of the slug is the key of the object, and the id shown is the UID of the page you want to appear at that navigation slug.
More features may be added to this object in the future, but for now, id
is the only option that can be set here.
URL Structure
Every page in a BetterForms URL starts with the domain name followed by the # symbol as shown. The # symbol allows the application to function like a single-page web app so that parts of the page can be changed without the browser needing to render the entire page again.
The domain section can be either a subdomain of fmbetterforms.com or your own custom domain,
https:// domain
/#/
The base URL will load whatever page is listed as the default key in your site's navigation slugs.
Other pages can be loaded either by ID or by their navigation slug. Using Navigation slugs is merely a shortcut to the page's ID, but they are the recommended method of building URLs for the following reasons:
They make URLs shorter and easier for your users to understand
You can easily update a page later across all of your site simply by updating the ID in your site's settings
.../#/navSlug
.../#/form/Page ID
Navigating by Page ID may not be supported in a future version of BetterForms in order to provide better support for other features. Always use a navSlug to maintain compatibility.
Query Parameters
Query parameters are additional values that can be passed with a URL as a page is loading. If you are new to query parameters, see this on Wikipedia.
BetterForms parses these values into a JSON object for your use in any scoped hooks. They are available in the $$BF_Query global variable.
You can also access the query from JavaScript using the utility function BF.getQueryParam(key)
.
Last updated