Ideas

Lava Functions

Lava Functions

Lava

I love lava. You can do some very complex searches with SQL and lava together. I've made what I might call very simple, custom software using Lava, SQL, and workflows.


The one thing Lava is missing is functions. I understand that perhaps the design is intended to push people to use Workflows instead of functions. But there are many things that should be coded in. At this point, I have to manage several pages that share code, and the ability to have lava functions would be incredible. Sometimes I don't need to call a whole workflow, I just need to throw some inputs and get some text out. Things like this.

I'm sure there is a way to get Javascript to kind of act as the way to implement functions with lava. But it would be incredible if one could simply program a bunch of Lava functions and call them throughout the site, calling them with lava. Perhaps similar to how you can call workflows.

Photo of Caleb DeLaurentis Submitted by Caleb DeLaurentis, Life Center  ·   ·  Lava
Login to add a comment...

  • Daniel Hazelbaker

    Hi Caleb. There is actually two ways to do Lava functions currently. The first is short codes https://community.rockrms.com/developer/bookcontent/33. These are basically "global functions". So for example if you have multiple pages that all take a Group entity and spit out a bunch of formatted HTML all in the same syntax, you can put that lava into a short code and just call that shortcode from each page.


    The second is the Lava Additions plugin (disclaimer, i'm the author). It's basically "local functions". You define a function in the Lava and then later on you can call that "function". Primarily useful if you need to use almost the exact same lava in multiple for/next loops and don't want to keep multiple copies of it up to date.