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.

Navigating Ethical Dilemmas in Digital Ministry

Daniel McPeak

Discuss the ethical challenges that arise with the use of digital technologies in ministry and how to address them.

Boosting Church Growth with Targeted Digital Outreach

Daniel McPeak

Learn how targeted digital outreach can help grow your church community and reach more potential members.

Utilizing Virtual Reality for Immersive Biblical Education

Daniel McPeak

Investigate how virtual reality technology can revolutionize biblical education by providing immersive learning experiences.

Effective Digital Strategies for Church Planting

Daniel McPeak

Explore how digital tools can enhance the reach and impact of church planting efforts.

Harnessing the Power of Online Video for Evangelism

Ted Decker

Learn why and how online video content can be a key tool in spreading the Gospel effectively.

Designing Accessible Digital Experiences for Church Members

Ted Decker

Ensure that your church’s digital resources are accessible to all members, including those with disabilities.

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.