briank

Kartra Membership Post-Specific Host

Jan 29th, 2021 (edited)
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.84 KB | None | 0 0
  1. <!-- For your info when editing in the membership builder (hidden in preview/live): -->
  2. <p>Kartra Membership Post Host: Joe User</p><!-- membership-post-specific-host+joe-user -->
  3. <script>
  4. // Replace Kartra membership post host information
  5. // Author: Brian Katzung
  6. (function (info) {
  7.     var social = false;
  8.     // Only run in preview or live, where we'll also hide the script
  9.     if ('app.kartra.com' === location.hostname) return;
  10.     document.currentScript.parentElement.parentElement.style.display = 'none';
  11.  
  12.     // $(function () { // Uncomment line for right sidebar support
  13.     $('.js_instructor_box_image').attr('src', info.img);
  14.     $('.js_instructor_box_name').text(info.name);
  15.     if (info.bio) $('.js_instructor_box_description').text(info.bio).show();
  16.     else $('.js_instructor_box_description').hide();
  17.     for (var attr of 'email facebook instagram linkedin twitter youtube'.split(' ')) {
  18.     if (info[attr]) {
  19.         social = true;
  20.         $(`[data-social_name="${attr}_url"]`).show().find('a').attr('href', info[attr]);
  21.     } else $(`[data-social_name="${attr}_url"]`).hide();
  22.     }
  23.     if (social) $('ul.social_list').show();
  24.     else $('ul.social_list').hide();
  25.     $('.panel.panel-blank[data-type="host"]').css('visibility', 'visible');
  26.     // }); // Uncomment line for right sidebar support
  27. })({
  28.     // img and name are required, the others are optional
  29.     img: "https://pixabay.com/images/download/user-33638_640.png",
  30.     name: "Joe User",
  31.     bio: "Kartra User", // null or "text"
  32.     email: "mailto:user@example.com", // null or "mailto:user@example.com"
  33.     facebook: "https://facebook.com/some.body", // null or "https://facebook.com/..."
  34.     instagram: null,
  35.     linkedin: null,
  36.     twitter: null,
  37.     youtube: null,
  38. });
  39. </script>
  40. <style>body > .container .panel.panel-blank[data-type="host"] { visibility: hidden; }</style>
  41.  
Add Comment
Please, Sign In to add comment