A dynamic page gives each record its own page. A dynamic block does the opposite: it lists many records on one page. Think of related posts at the bottom of a blog article, a page of available courses, or a list of upcoming events. In our vet clinic portal, we'll build a page that lists the visiting client's pets, with a link to each pet's own page.
You can add a dynamic block to a regular Ontraport page or to a dynamic template. Use a regular page for a one-off page, like "My pets." Click Pages in the top navigation, then New page. Use a dynamic template when the list belongs on a page you repeat, like related posts on every blog article. Hover over Pages and click Dynamic Templates. Either way, you'll need a Dynamic CMS package on your account. To convert a block, select it and click the settings wheel. Click the database icon, pick a data source, and click Convert.
The data source decides what kind of record the block lists. The first section shows the objects, users and products in your account. Pick one of these to list all of its records, like every course you offer.
Below that, Related to visiting contact lists the objects that belong to a contact, like files, open orders and your own custom objects. For our portal, pick Pets here, not in the top section. The top option lists every pet in your account. This one lists only the visitor's pets. Choose carefully, because you can't change a block's data source after you convert it. If you need a different one, add and convert another block.
Ontraport recognizes visitors who have its cookie, from clicking an email link, filling out a form or clicking a tracked link, and members who log in to your membership site. For private information, the safest choice is to require a login. The Privacy and data security lesson covers this in depth.
Now design a single item. Lay it out with rows and columns, then add elements: for a pet, an image, a subheadline and some text. Hover over an element, click the database icon, and pick a field, like the pet's photo or name. The field replaces the whole element. To drop a field into regular text, use the merge field dropdown instead. On a dynamic template, you can also add fields from the page's own record. Click Save. That one design repeats for every record. So any static text inside the block repeats too. Put headings and labels outside the block.
To check your work, click the arrow next to the Preview button. Choose a record under Data Source, and a contact under View as Contact. Then click Preview to see every record the block will show. Pick records with values in the fields you used, or the preview will look blank.
Next, link each item to its own dynamic page. Add a button, like "See details," or highlight some text, and open the link settings. Choose Link to a page related to the displayed record, pick the page type, like Pet details, and click Insert Link. You'll see the page types you've published for that object. You can also link to a URL field saved on the record, like a website address.
To choose which records appear, hover over the block, click the edit dynamic block icon, and click Dynamic Block Settings. Display conditions filter the records, not the visitors. For example, show only pets whose type is Dog. Want dogs and cats in separate lists? Use one block for each. On a blog template, the condition "Record is not the same record as the Dynamic Page it appears on" keeps the post someone's reading out of its own related posts. You can also filter by relationships: records the visiting contact is or isn't related to, or, on a dynamic template, records related to the page's own record, like the visit notes on each pet's page.
Then come the record settings. One column gives you a vertical list. More columns give you a grid, and you can turn on Only show full rows, so no item sits alone at the end. Just know the leftover records won't show. Choose how many records display on the initial load, and which record number to start on. Sorted newest first, starting on record two lets one block feature your latest post while another lists the rest. For additional records, choose Previous/Next to add paging buttons, or None to show only the first batch. Then sort by any field, or Random, ascending or descending. Click Done.
Converting a block also adds a pagination block with the Previous and Next buttons. To style them, hover over it, click the edit dynamic block icon, and choose Pagination Style. To hide them, change the dynamic block's settings instead.
On a dynamic template, you can also decide whether the whole block appears. Click Edit Dynamic Block, then Display Settings, and turn on "Only show this block if the dynamic page record meets these conditions." For example, show it only if the contact has made a purchase.
Two quick design tips. Each block has 40 pixels of padding at the top and bottom, so repeated items sit 80 pixels apart. Reduce the padding for a tighter list. And build with rows and columns, not element position settings, so the list holds up on mobile.
Dynamic blocks work with two more features. Add the search element to a page, and visitors can search the records a dynamic block lists. On an Ontraport membership site, add reaction buttons, so logged-in members can like, favorite or mark items complete. And remember, dynamic blocks only work on pages hosted by Ontraport. They don't appear through the Ontrapages WordPress plugin.
So: convert a block, pick its data source, link its elements to fields, link each item to its page, and use the block's settings to choose which records show and how. Next up, we'll set up page types and publish your dynamic pages.