-
Notifications
You must be signed in to change notification settings - Fork 17
Lava
Lava is the life blood of Rock and Avalanche follows suite. Almost anywhere you can enter text you can also use Lava. All the normal merge fields such as CurrentPerson
or commands like those for entities are available. However, Avalanche has some special circumstances that necessitates additions to Lava. This page lays those out so you can begin to use your app to it's fullest.
One of the most important things to learn about Avalanche is that each page that is loaded can be loaded with a parameter. This parameter might be something like a Content Channel Id or a Person's Guid. This allows you to create one page and dynamically load data based on the content requested.
Avalanche adds in the merge field parameter
so that you can use this information directly from Lava. An example of this might be:
{% contentchannelitem id:'{{parameter}}' -%}
{% if contentchannelitem.ContentChannelId == 25 -%}
{{contentchannelitem.Content}}
{% endif %}
{% endcontentchannelitem -%}
If you are using Lava for both the web and app you might wish to know who is requesting it. Avalanche adds in the merge field 'IsMobileApp' with the value of "true".
Because Avalanche uses all native controls, it doesn't understand HTML. Instead it uses Markdown for its styling. You might notice a problem with this. Your content channels are probably full of HTML and the thought of rewriting everything in Markdown isn't a good one. That's why we added the 'HtmlToMarkdown' filter.
Using the above example we can convert our content simply by doing this:
{{contentchannelitem.Content | HtmlToMarkdown}}
Our vision is to see the reach of the web and the power of data to join forces to make disciples.