Product changes

image description

New feature - Count limited collections

How often do you need pagination for your Betty web pages? This will often lead to slow page loads. To help you build pages that load a lot quicker, we've introduced the count_full_collection() expression function.


Currently, if you want to paginate over a certain collection, you have to fetch the collection twice. Once with the limit and offset and once without in order to show a total count. With the count_full_collection() function, you can create a collection variable with offset and limit as you previously did (e.g. "products"). Now, however, you can create a second variable that counts all records for the given model and filter without the limit and offset, with count_full_collection(var:products). This should drastically improve the load times of pages where you paginate over large collections of data.

Read more

image description

New feature - Layouts and partials

If there's something we can all agree on, it's that repetition is inefficient and error prone. Let me repeat that, repetition is ineccifient and erorr prone... It is for this reason that we introduced layouts and partials to the UI builder.

At the top left you'll find a new tab 'Partials'. The header and footer are included in the layout.

Layouts:

Let's say you want to have the same menu bar and footer on each of your pages. You can now create layouts that contain said menu bar and footer and then have the contents of each page rendered inside those layouts.

Partials:

Conversely, it could be that you created a great looking social media share bar and want to include it in multiple pages. Adding and maintaining that bar for each of those pages can be cumbersome. What if you wanted to change the colour of one of the buttons for each of those bars? Now, you can create a partial for that bar and simply include that partial every time you want your page to render your social media bar.

Talk about efficiency!

Read more

image description

Update - Callback actions for imports

It is now possible to pass your imported records to the callback actions for import events. This new piece of flexibility should be enough to cover all your import-ant needs *wink*


You'll find the callback action option at the bottom of an import event

This feature enables you to use the imported records in subsequent events.

Think of assigning all the imported records to a certain "Relation" model for instance. Or you could just simply email the user once the event has finished importing all records. 

Simply enable a callback action for your import event and check the "process imported records" checkbox. The batch action you assign here, will be executed for each imported record after the import has imported all records.

Read more

Experience Betty Blocks