Skip to content

Instantly share code, notes, and snippets.

@greggnakamura
Created December 4, 2019 15:17
Show Gist options
  • Save greggnakamura/0066345faccea3ff75fa910ba73c2534 to your computer and use it in GitHub Desktop.
Save greggnakamura/0066345faccea3ff75fa910ba73c2534 to your computer and use it in GitHub Desktop.
Kentico: Bizform in Transformation with conditional visibility of repeater content
<script runat="server">
protected override void OnDataBinding(EventArgs e)
{
ModalBizForm.FormName = Eval<string>("HorizontalCTABizform");
ModalBizForm.ReloadData();
}
</script>
<div class="col-12 col-md-6 col-lg-4 mb-3 mb-lg-0">
<asp:placeholder runat="server" Visible='<%# Eval<string>("HorizontalCTADisplayAs") == "link" %>'>
<a class="btn btn-lg btn-secondary text-uppercase w-100" href="<%# Eval("HorizontalCTALink") %>">
<%# Eval("HorizontalCTALinkText") %>
</a>
</asp:placeholder>
<asp:placeholder runat="server" Visible='<%# Eval<string>("HorizontalCTADisplayAs") == "modal" %>'>
<button type="button" class="btn btn-lg btn-secondary text-uppercase w-100" data-toggle="modal" data-target="#cta-form-modal-<%# Eval("Data_HorizontalCTAID") %>">
<%# Eval("HorizontalCTAButtonText") %>
</button>
<div class="modal fade" id="cta-form-modal-<%# Eval("Data_HorizontalCTAID") %>" tabindex="-1" role="dialog" aria-labelledby="cta-form-modal-<%# Eval("Data_HorizontalCTAID") %>-title" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body links-white headings-white">
<div class="text-center mb-4">
<h4 class="font-weight-bold" id="cta-form-modal-<%# Eval("Data_HorizontalCTAID") %>-title">Retirement Home Equity Inquiry</h4> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae dignissimos inventore deleniti accusamus quo.
</div>
<!-- bizform -->
<cms:BizForm ID="ModalBizForm" runat="server" Visible='<%# Eval<string>("HorizontalCTADisplayAs") == "modal" %>' />
</div>
</div>
</div>
</div>
</asp:placeholder>
<asp:placeholder runat="server" Visible='<%# Eval<string>("HorizontalCTADisplayAs") == "text" %>'>
<span class="btn btn-lg btn-outline-green-dark text-uppercase w-100">
<%# Eval("HorizontalCTAStyledText") %>
</span>
</asp:placeholder>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment