[Code] Dynamic Links using Custom Fields

Article author
Duncan Hamra

Step 1: Install Memberstack Extended (MSX) script

Add the following code to the <BODY> section in your global site scripts.

<script type="module" src="https://memberstack.github.io/memberstack-x/dist/memberstack-x.es.js"></script>

Step 2: Add this Data Attribute to Links or Buttons

Add the following data attribute to any anchor link or button element. Replace the value inside quotes with the custom field ID that you want to source URL values from.

data-ms-x:link="your_custom_field_with_link_value"

For example, if you have a custom field with the ID: facebook-profile:

data-ms-x:link="facebook-profile"

Was this article helpful?

Comments

2 comments

  • Comment author
    Xavier

    Just a heads up that the code provided is slightly different than that in the video. I believe it should be: 

    <script
    	type="module"
    	src="https://memberstack.github.io/memberstack-x/dist/memberstack-x.es.js">
    </script>

    This feature is awesome though! 

    1
  • Comment author
    Duncan Hamra

    Xavier Updated! Thank you 🙏

    0

Please sign in to leave a comment.