What are Pages?
Knack uses pages and views to build your live app.
A view is a visual element like a form, table, or search that works with records in your database.
A page is used to group multiple views into one web page. Your Live App can have multiple pages that your users can navigate with menus and links.
Where Do I Access Pages?
In the Builder, you can access your pages by clicking on the large Pages tab in the left column. All of your pages are listed in the page tree. You can click on any page in your list to see its views and settings.
Here is an example page tree from the contact directory template app:
Page Types
There are different types of pages with their own set of capabilities and uses.
- Start Page: A starting point into your app. A start page can be either a parent page or standalone page.
- Parent Page: A page that has other pages (child pages) that it links to.
- Child Page: A page which is linked to by another page. It can never be a standalone page.
- Login Page: A page with a login view that password protects its child pages by requiring a user to login.
- Detail Page: A page which knows about a single record in your app. This page will show a details view of individual records and is often linked to by table, list and search views.
- Single Record Page: Any child page that knows about a single record and will display Details Views, Edit Forms, or connected records.
- User Page: A user page is designed to handle administrative user tasks. User pages are not included in the Page Menu. Instead, they are included in their own User Menu. For more on user pages, click here.
1. Login page, start page, parent page
2. Details page, child page
3. Start page, parent page
4. Details page, child page, parent page
5. Single record page, child page
6. User page, start page
Manage Pages
Add a Page
You can add a page by clicking the “+ADD” button in the left column:
Edit a Page
When you select a page from the page tree, you can edit that page using the “Settings” tab at the top or the “settings” icon in the page tree:
Copy and Link to an Existing Page
If you start to work with many pages in your Live App, you can save some time by copying pages or reusing the same pages by adding links to existing pages.
Copy a Page
You can copy any of the start pages in your page tree.
Find the start page you want to copy and use the “settings” icon to access the “Copy” option. A new window will pop up where you can give the copied page a name.
Click “Copy” and your new page will be immediately copied and accessible in your Live App. All views and child pages will also be copied.
Link to an Existing Page
Any child page can be reused by other views that are displaying records from the same object. This is particularly useful if you have complex detail layouts or forms and you don’t want to set it up again.
For example, in a table you can click on the “Links” tab and then select "Link to another page." You can then choose from any other child pages to connect to:
A new link will be added to this table, which will route to the existing Edit Contact page.
Adding these links does not copy these pages, just links to them. So editing the original page will affect any views that are linking to that page.
Knack Tip: Not seeing an existing page you want to link to? Remember that only pages with views displaying records from the same object are eligible. For example in a Contacts table, you can only link to an existing Contacts child page, and any grandchild page created from that child page.
Collapse/Expand Pages
If your page tree becomes too big to fit neatly on your monitor, the start pages will collapse to only show your currently selected page. You can click on the small arrows to the left of the collapsed start pages individually to show all the child pages:
Delete a Page
You can delete a page by clicking the “settings” icon and selecting the “Delete” option. You'll be asked to confirm the delete.
Warning: Deleting a page is destructive. Any views and child pages will also be deleted.
When you delete a page/view and another view is using it via link to an existing page, the linked child page will be moved to the other view instead, becoming its new parent. Click here for more information.
Build a Page
Add a Start Page
Your Live App will always have at least one start page.
In the example below, the Live App contains two start pages: one for Companies and one for Contacts:
The first time you visit the Pages section, you'll be prompted to create your first start page. You can add as many additional start pages as you need by clicking the “+ADD" button in the left column.
This brings up a new window that will guide you through adding your page. Don’t worry about selecting every view in the Quick Start, you can always add more views after adding the page.
If you’d like to skip the Quick Start, simply select the “Blank Page” option and you can add your views later:
Start pages are independent of any other page in your app. This means that when adding a view using the view menu on a start page, you'll be able to add a view for any of the objects in your database.
Start pages can add links to the page menu and can also be embedded as independent apps.
Knack Tip: The page menu is the navigation menu your users see in the Live App. Click here for more on the page menu.
Add a Child Page
A child page is created from a link on a parent page. It can’t exist as a standalone page.
Your users can navigate to different child pages by clicking on links and menus in each view. For example:
- a menu can display links to one or more child pages.
- a table or list can link to a child page to show more details about each record displayed.
- a details view can link to a child page to edit the same record, or insert child records.
You can view child pages by clicking on the page in the page tree or from the links below each view. When hovering over the link underneath the view, Knack will highlight the corresponding page in the page tree:
You'll often add child pages automatically when adding pages and views through the Quick Start wizard. For example, if you are adding a table view, you'll have options for adding child pages:
When working with existing views, you can access the Links tab to add a new child page:
Page Settings
You can customize other options for a page from the “Settings” tab.
You can access page settings by either selecting a page and clicking on the “Settings” tab at the top of the Pages section, or clicking the “settings” icon next to the page in the page tree:
Page Name
The page name will display in menus and links throughout your Live App.
Page URL
Knack builds a URL for each page by including what you add here, as well as some record identifiers when necessary.
The Page URL follows the app name, so the URL to access the Companies page is:
Every view linking to this page will be automatically updated to use this new URL.
Notes
- You'll need to update any links manually that you've typed in or entered outside the app.
- Page URLs need to be all lower case and can only contain alphanumeric characters.
Page Menu
By default, every start page you add is automatically included in the Page Menu. If you’d like to remove a specific page from the menu, uncheck the box labeled "Display the Page Menu when viewing this page."
A page with no page menu looks like this:
The Contact Directory template starts with three start pages. Here we exclude the Companies page from the page menu, but we still display a link for it. When viewing the Companies page in the Live App, we’ll see a menu with only two links:
Page Icon
Every start page can have an individual icon next to its name to represent it. Click the “add icon” link to select your icon. It will then display in the page menu:
Options
Add a Print Link
You can add a print link to your pages. This link will display in the upper right section of the app. Clicking that print link will send a printer friendly version of that page to the browser's print function:
Knack Tip: The print link will be disabled if you’re also using the modal popup option. Click here for information on printing PDFs.
Display in a modal popup
Enabling this option will cause your entire page to render in a modal popup. This is great for scenarios where you want to view/modify records, but not have to open an entire new page to do so:
Knack Tip: A page will only display as a modal popup if a Knack page is already rendered underneath it. This means you can still use the URL to navigate to this app from outside your Live App. However, it will load the full page instead.
Pages & User Logins
If you have different roles enabled for your Live App, you can control login access to each page individually. By adding a user login to your page, a user must login before they see any of the views on that page:
Add a Login
To add a login, click on the “Login” tab at the top of the page, then click the “Add Login” button. You can choose to allow access to all user roles or restrict it to specific ones.
If this is your first time adding a login, you’ll need to enable user roles first. We recommend setting your app to have logins for different pages and user roles:
If you add a login to a start page, that login will be required for all child pages underneath it.
If the start page does NOT have a login, you can add a login to any child page individually. This is useful for when you want to have a public list of records, but require user access to view more details or make changes. You can do so by clicking on the gear-shaped icon next to the page in your Builder and selecting 'Require Login' from the dropdown:
Knack Tip: When working with multiple start pages and multiple user roles, be sure to give the users the URL to their corresponding start page. Otherwise, they may land on a page they don’t have access to. Click here to learn how to create a single start page for all user roles.
Edit a Login
If your page already requires a login, you can modify it by navigating to the login page (marked with a special key icon) and clicking the “Login” view:
Delete a Login
If you want to remove login requirements from a specific page, navigate to the login page and use the “settings” icon to access the “Delete” option. You will need to confirm the deletion in order to proceed.
Note Deleting a login page will not delete it's child pages.
Page Rules
Page rules are actions that can be automatically triggered based on conditions you define as soon as a user enters a page.
For example, let's say your users can register for a specific event with limited availability. A page rule can be defined to hide the registration form when availability reaches zero.
Click here for more information on setting up page rules.
Notes & Troubleshooting
- When you delete a page/view and another view is using it via link to an existing page, the linked child page will be moved to the other view instead, becoming its new parent. Click here for more information.