Helix
Triumph TechLava DocsRock Styling
  • Getting Started
    • 👋Welcome
    • Overview
    • Customizing Rock
    • Plugin Installation
    • FAQ
    • Roadmap
    • 🚨Security
  • HTMX
    • Learning More
    • Syntax Style Guide
  • Lava Applications
    • Overview
    • Applications
    • Endpoints
    • Content Block
    • Magnus
    • Observability
  • Lava Commands
    • Delete Entity
    • Modify Entity
    • DB Transaction
    • HTTP Response
    • Render Lava Endpoint
  • Forms & Controls
    • Understanding Forms
    • Using Form Controls
    • Creating New Controls
    • Form Validation
    • Loading Indicator
  • Strategies
    • Tips
    • Related Entities
    • Limitations
Powered by GitBook
On this page
  1. Lava Commands

Render Lava Endpoint

Sometimes, a Lava Endpoint generates content you'd like to display immediately when the page loads. While you could use HTMX to trigger a call to the endpoint on load, this approach introduces an extra HTTP request and might cause page layout shifts as the content loads.

To address this, we introduced the renderlavaendpoint command. This command processes the Lava from the specified endpoint and injects the results during the initial page load, effectively acting like a Lava Shortcode.

Here's an example:

{% renderlavaendpoint route:'^/group-finder/showgroups' %}

There's one optional parameter 'method' that allows you to specify the HTTP method for the endpoint. If you don't provide this 'GET' is assumed.

{% renderlavaendpoint route:'^/group-finder/showgroups' method:'post' %}
PreviousHTTP ResponseNextUnderstanding Forms

Last updated 4 months ago