Jump to content

Memberspace Observe Log in Status

Recommended Posts

A member asked via DM to be able to make alterations to a page based on being logged into MemberSpace or not. This code observes the MS data structures and will run callback code based on login status. On its own the code does nothing but watch. You need to provide the callback functions.

Please see Memberspace Observe Log in Status.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
  • Replies 1
  • Views 277
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Here is a callback function that removes the header home link when logged in to MS.

<script>

  const headerHomeRemoveWhenLoggedIn = ( ) => {
  
    /*
    
      header home remove when logged in
      
      Version       : 0.1d1
      
      SS Version    : 7.1
      
      Dependancies  : memberspace observe log in status
      
      By            : Thomas Creedon < http://www.tomsWeb.consulting/ >
      
      */
      
    $( '.header-nav-item--homepage' ).remove ( );
    
    }
    
  </script>

This code must be installed before the Memberspace Observe Log in Status code. Then in the Memberspace Observe Log in Status code change the following...

    const isLoggedInCallback = undefined;
    

...to...

    const isLoggedInCallback = headerHomeRemoveWhenLoggedIn;
    

 

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

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...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.