Dialog (Bootstrap)

Overview

Dialogs offer a fantastic way to display additional information without needing to load a new page. However, dynamically loading data into them used to require significant JavaScript effort. Thankfully, those days are behind us!

Client Content

Below is the Lava template for the front-end client. Here we'll load the inital list of articles. When an individual clicks "Read More" we'll show the full article.

{% contentchannelitem where:'ContentChannelId == {{ ConfigurationRigging.ArticleContentChannelId }}' limit:'10'%}

    <div class="row">
    {% for item in contentchannelitemItems%}
    
        <div class="col-sm-12 col-md-4 d-flex">
            <div class="article card d-flex flex-column justify-content-between rounded-lg overflow-hidden mb-3">
                <div class="card-img-top position-relative">
                    <div class="card-overlay bg-cover w-100 h-100" style="background-image:url({{ item | Attribute:'Image','RawValue'}});"></div>
                </div>
                <div class="card-body">
                    <h5 class="card-title mb-1 text-bold">{{ item.Title}}</h5>
                    <p class="card-text small text-muted">{{ item | Attribute:'Author'}}</p> 
                    <p class="card-text">{{ item | Attribute:'Summary'}}</p>
                    
                </div>
                <div class="card-footer">
                    <a class="btn btn-primary btn-sm"
                        hx-trigger="click"
                        hx-get="^/helix-gallery/article-detail?articleKey={{ item.IdKey}}" 
                        hx-target="#article-detail-modal" 
                        data-toggle="modal" 
                        data-target="#article-detail-modal">Read More</a>
                </div>
            </div>
        </div>
        
    {% endfor%}
    </div>
    
{% endcontentchannelitem%}

<div id="article-detail-modal"
    class="modal modal-blur fade"
    style="display: none"
    aria-hidden="false"
    tabindex="-1">
    <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
        <div class="modal-content"></div>
    </div>
</div>

Endpoint Template

Here is the Lava template for the endpoint.

{% assign articleId = QueryString.articleKey | FromIdHash%}

{% contentchannelitem id:'{{ articleId }}' securityenabled:'false'%}

    <div class="modal-dialog modal-dialog-centered">
      <div class="modal-content">
        <div class="modal-body">
            <img class="w-100 rounded-lg" src="{{ contentchannelitem | Attribute:'Image','RawValue'}}">

            <h5 class="mt-3 text-bold">{{ contentchannelitem.Title}}</h5>
            <p>
                {{ contentchannelitem.Content}}
            </p>
        </div>

        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        </div>
      </div>
    </div>

{% endcontentchannelitem%}

Demo

Here's the working demo of this feature, currently paging five items at a time. For most use cases, you may want to load more items simultaneously.

Expanding Your Church's Reach with AI-Powered Chatbots

Pete Foster

Explore how AI-powered chatbots can enhance visitor engagement and provide personalized pastoral care online.

Creating a Digital Giving Strategy That Works

Jenny Michaels

Learn how to effectively implement and promote online giving to support your church’s financial health.

Leveraging Social Media for Youth Engagement

Daniel McPeak

Discover effective strategies for engaging young church members through platforms they frequent.

The Role of Data Analytics in Personalizing Pastoral Care

Ted Decker

Examine how data analytics can help personalize pastoral care and create deeper connections within your church community.

Developing a Multi-Channel Communication Strategy for Churches

Jenny Michaels

Learn how to create a multi-channel communication strategy to effectively reach your congregation through various digital platforms.

Optimizing Your Church's Website for Search Engines

Pete Foster

Discover the best practices for search engine optimization (SEO) that can help your church's website gain more visibility and attract new visitors.

Enhancing Virtual Church Services with Interactive Elements

Pete Foster

Explore ways to make virtual church services more interactive and engaging for congregants.

The Power of Digital Storytelling in Ministry

Ted Decker

Discover how digital storytelling can be a powerful tool for sharing faith and engaging congregants.

Setting Up Safe Digital Spaces for Youth

Pete Foster

Learn how to create safe, engaging digital spaces for youth ministry that promote healthy spiritual growth.

Managing Church Social Media Accounts: Best Practices

Daniel McPeak

Best practices for managing your church’s social media accounts to maximize impact and foster community.