Check if we are on the root URL with Liquid | Adobe Business Catalyst

if else condition in business catalyst

{% if globals.get == blank -%}
    // we are on the root URL - do something
{% else -%}
    // we are not on the root URL
{% endif -%}

Placeholder for Captcha | Adobe Business Catalyst

<script>
$(document)
    .ready(function () {
        $('#CaptchaV2')
            .attr("required", true)
            .wrap('<div/>')
            .after("<small class='error'>Captcha is required.</small>");
        $('.contact-form .captcha')
            .find("input[type=text]")
            .each(function (ev) {
                if (!$(this)
                    .val()) {
                    $(this)
                        .attr("placeholder", "Enter text to verify");
                }
            });
    });
</scrip>

Dev-in-a-Box Jquery plugin is useful to build better websites, faster | Adobe Business Catalyst

It allows you to add the most common JavaScript-based features to your BC sites using simple HTML5 data attributes. Dev-in-a-Box is simple enough for the noobie, yet powerful enough for a developer. It's the ideal plugin for any Business Catalyst site.

Dev-in-a-Box is being integrated into the BC Pie framework and is now FREE! You can currently find Dev-in-a-Box on theBC App Store.

Add span tag to first word in title | Adobe Business Catalyst

<script>
$('#content h1').each(function(){
   var me = $(this)
      , t = me.text().split(' ');
   me.html( '<span>'+t.shift()+'</span> '+t.join(' ') );
 });
</script>

Smooth Page Scrolling when click a tag ID | Adobe Business Catalyst

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script>
$(function() {
   $('a[href*="#"]:not([href="#"])').click(function() {
       if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
           var target = $(this.hash);
           target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
           if (target.length) {
               $('html, body').animate({
                   scrollTop: target.offset().top
               }, 1000);
               return false;
           }
       }
   });
});
</script>

Words limit for title using jquery | Adobe Business Catalyst

<script>
$(document).ready(function(){
   $('.project-details').each(function(i, e){
       var projTypeTitle = ($(e).find('h3'));
       var projTypeTitleArr = projTypeTitle.text().split(' ');
       suffixText = '';
       
       if(projTypeTitleArr.length >= 4){
           suffixText = '...';
           projTypeTitleArr.splice(4);
       }
       projTypeTitleChanged = projTypeTitleArr.join(" ") + suffixText;
       projTypeTitle.text(projTypeTitleChanged);
   })
});
</script>