Handy tools to be used with Lava

By Steven Schulte

One of the many ways people start learning how to use Lava for their Rock environment is simply by jumping in headfirst, with no direction. This could take form of a Rock recipe, a web page, or simply a workflow that was created by someone before you.

Rarely does anyone know what to do when they see some odd-looking code and know what the next steps are. In this article, we propose five useful tools that we wish we had known when we started. We chose these 5 tools based on our personal journey in working with Rock, which spans all the way back to the origins of Rock.

Before we dive in though, let’s clarify what Lava is. Quoting directly from the Rock Documentation, “Rock is about power and flexibility. Lava adds both by allowing you to tailor the application to meet your specific needs.” Furthermore, Lava will allow you to control what is displayed to your users by utilizing the power of data from your Rock application. This ranges from pulling in content from a content channel, to displaying members from a group, or simply personalizing a user’s experience based on their profile.

Tool 1

Lava Documentation

For the first tool, we highly recommend the Rock Lava documentation. You should have it booked marked. Better yet, memorize the URL: rockrms.com/lava. We always find ourselves going back to this page and exploring what Lava has to offer. Also, don’t skip the “Other” category. Some of our personal favorites are under there – such as “Debug”, “HasRightsTo”, “Page”, and “PageRedirect”.

Tool 2

Lava Tester

Secondly, the Lava Tester. You can think of this tool as your Lava playground, and you can find it under Power Tools (Home > Admin Tools > Power Tools > Lava Tester). This handy tool gives you the ability to test your Lava code while also leveraging the power of a person, group, workflow type, and registrations.

Tool 3

Model Map

Thirdly, the Model Map. If you can spend some time swimming through the Rock Model, you will be doing yourself a great favor when it comes to debugging or knowing where some of the data lives. You can always use the “{{ debug }}” statement to see some additional information, but this does not always solve the case. You will find this tool under Power Tools as well (Home > Admin Tools > Power Tools > Model Map), and when looking through it, you can see all the available options in Lava if there is a lightning bolt symbol next to it . By doing this, you will also be able to leverage Lava entity commands to pull in specific data.

Tool 4

VS Code

Next, the Visual Studio Code (VS Code) software. This is not a need, but if you ever find yourself squinting your eyes looking at lava through Rock or trying to scroll up and down in a small box where all the lava is – then this might be a better solution. Although, this is a developer software, you can think of this as a fancy text editor. You would simply copy the code from your Rock environment and paste it into a window of this software, and it will help you visualize your Lava code with color and ease. Once you make your changes, then you would copy and paste the code back into Rock. You could use the file manager to transfer lava files as well. For more information and installation, you can follow this link: https://lavadocs.garrett.io/getting-started/

Tool 5

Lava Fluid

Lastly, with new changes in Rock going forward, make sure you familiarize yourself with “Lava Fluid”. By doing this, you will know what to look for in your existing lava code, and possibly find reasons why it was working before and not when switching engines. You can find the Fluid differences at this link: https://community.rockrms.com/lava/fluid/differences. The old DotLiquid engine will go away entirely in the future, so the sooner you know the differences and make changes, the better off you will be in the future.

In summary, we introduced the five basic tools that we have used in our journey with Rock and use them daily; they are the Lava documentation, Lava Tester, Model Map, VS Code, and the Lava Fluid documentation. There are plenty more tools for Lava (check out the Rock shop) and we encourage you to continue to explore.

If you have any questions, suggestions, or would like some help with some of these tools, we would love to hear from you.