Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Mindbody login code snippet into nav


simacna

Question

Site URL: http://www.goodtimepilates.com/

Hi all,

 

I'm trying to add a code snippet that allows users to login into their Mindbody profiles into my squarespace via the top nav, using the method prescribed by the Mindbody directions here or this YouTube video here (both are the same directions). When I follow the directions (adding a link, pasting <script src...> into Link Title, putting placeholder url in Link), instead of a clickable text appearing that reads Login | Register, I get the "<script>" tag pushing everything aside (screenshot below), essentially Squarespace can't parse the code and is displaying it directly as is. Any idea why? 

 

Thank you!

Screen Shot 2021-04-23 at 9.35.50 AM.png

Edited by simacna
Link to comment

11 answers to this question

Recommended Posts

  • 1

The method MB described will not work for v7.1.

They took advantage of an unintentional method of slipping code into a place where SS didn't intend in v7.0. SS fixed that in v7.1.

I have a solution for v7.1. It requires the business plan or above.

Add the following to Settings > Advanced > Code Injection > HEADER.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

Add the following to Settings > Advanced > Code Injection > FOOTER.

<script>

  $( ( ) => {
  
    /*
    
      add mindbody login register link to navigation
      
      Version    : 0.1d0
      
      SS Version : 7.1
      
      By         : Thomas Creedon < http://www.tomsWeb.consulting/ >
      
      */
      
    const dataSiteId = '100795';
    
    const dataMbSiteId = '658429';
    
    // do not change anything below, there be the borg here
    
    $( '<script src="https://widgets.mindbodyonline.com/javascripts/healcode.js" type="text/javascript"><\/script>' +
      
      '<healcode-widget data-version="0.2" data-link-class="loginRegister" data-site-id="' + dataSiteId + '" data-mb-site-id="' + dataMbSiteId + '" data-type="account-link" data-inner-html="Login | Register" />' )
    
      .appendTo ( '.header-nav-list, .header-menu-nav-folder-content' );
      
    $( 'healcode-widget:first' )
    
      .addClass ( 'header-nav-item header-nav-item--collection header-nav-item--active' )
      
      .attr ( 'data-animation-role', 'header-element' );
      
    $( 'healcode-widget:last' )
    
      .addClass ( 'container header-menu-nav-item header-menu-nav-item--collection' );
      
    } );
    
  </script>

This is for v7.1.

Let us know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

Link to comment
  • 0
Posted (edited)

@tuanphanthanks, it's below, but my hunch is Squarespace's version is now 7.1 and the instructions given by Mindbody is for v7.0, that might be the culprit. Happy to add any other info for troubleshooting. 

 

 

 

<script src="https://widgets.mindbodyonline.com/javascripts/healcode.js" type="text/javascript"></script><healcode-widget data-version="0.2" data-link-class="loginRegister" data-site-id="100795" data-mb-site-id="658429" data-type="account-link" data-inner-html="Login | Register"  />

Edited by simacna
Link to comment
  • 0
On 4/27/2021 at 6:33 AM, simacna said:

@tuanphanthanks, it's below, but my hunch is Squarespace's version is now 7.1 and the instructions given by Mindbody is for v7.0, that might be the culprit. Happy to add any other info for troubleshooting. 

 

 

 

<script src="https://widgets.mindbodyonline.com/javascripts/healcode.js" type="text/javascript"></script><healcode-widget data-version="0.2" data-link-class="loginRegister" data-site-id="100795" data-mb-site-id="658429" data-type="account-link" data-inner-html="Login | Register"  />

Can you check your site url? I can't access it.

 

 

Email me if you have need any help (free, of course.). Answer within 24 hours.

How to: Setup password & share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 0

@tuanphan Right now on the live website, for the registration I have it just as a link to another site. I'd like that to be a login button that works as a model (which happens if it embed the <iframe> i posted above into a <code> block and according to the instructions in the the link above, should work in the hacky way for squarespace v7.0 but I'm on v7.1 😞

Link to comment
  • 0

Thanks for checking @creedon and they're right, the adding a calendar works, my issue is adding a Login|Register button on the navigation (https://support.mindbodyonline.com/s/article/Putting-a-Login-Register-link-in-the-navigation-on-SquareSpace-7-branded-web-tools-formerly-HealCode?language=en_US) which asks the <iframe> to be place in the Text field, this is where the parsing issue happens. Can you replicate the functionality on your Squarespace v7.1 too? That'd be amazing.

Link to comment
  • 0
On 4/29/2021 at 1:20 PM, creedon said:

The method MB described will not work for v7.1.

They took advantage of an unintentional method of slipping code into a place where SS didn't intend in v7.0. SS fixed that in v7.1.

I have a solution for v7.1. It requires the business plan or above.

Add the following to Settings > Advanced > Code Injection > HEADER.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

Add the following to Settings > Advanced > Code Injection > FOOTER.

<script>

  $( ( ) => {
  
    /*
    
      add mindbody login register link to navigation
      
      Version    : 0.1d0
      
      SS Version : 7.1
      
      By         : Thomas Creedon < http://www.tomsWeb.consulting/ >
      
      */
      
    const dataSiteId = '100795';
    
    const dataMbSiteId = '658429';
    
    // do not change anything below, there be the borg here
    
    $( '<script src="https://widgets.mindbodyonline.com/javascripts/healcode.js" type="text/javascript"><\/script>' +
      
      '<healcode-widget data-version="0.2" data-link-class="loginRegister" data-site-id="' + dataSiteId + '" data-mb-site-id="' + dataMbSiteId + '" data-type="account-link" data-inner-html="Login | Register" />' )
    
      .appendTo ( '.header-nav-list, .header-menu-nav-folder-content' );
      
    $( 'healcode-widget:first' )
    
      .addClass ( 'header-nav-item header-nav-item--collection header-nav-item--active' )
      
      .attr ( 'data-animation-role', 'header-element' );
      
    $( 'healcode-widget:last' )
    
      .addClass ( 'container header-menu-nav-item header-menu-nav-item--collection' );
      
    } );
    
  </script>

This is for v7.1.

Let us know how it goes.

This works for me! But now it's affecting other widgets on my site. 😞

Link to comment
  • 0
On 8/26/2021 at 6:17 AM, lindz5223 said:

This works for me! But now it's affecting other widgets on my site. 😞

Can you share link to your site? Which widget you want the code affect on?

Email me if you have need any help (free, of course.). Answer within 24 hours.

How to: Setup password & share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...