creedon Posted January 21, 2022 Share Posted January 21, 2022 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
creedon Posted January 22, 2022 Author Share Posted January 22, 2022 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment