Creating and displaying users unique image & text Answered

Post author
webflow pro guy

Hey guys, I have an automation to create an image based on user custom fields.

I want to display users unique image generation on their dashboard page.

I tried to do it this way using webflow html:

<img src=""ms-member=image-url"" alt=""alt text here"">

But it doesn't display properly. is there something Im missing?

Thanks guys :0

Comments

7 comments

  • Comment author
    Julian Galluzzo

    How is the image being generated? Could you add a live link?

    0
  • Comment author
    webflow pro guy

    Hey mate, I actually referred to this to display the image URL! https://www.memberstack.com/scripts/add-url-from-custom-field-to-iframe-src

    The only problem im having is making the image fit within the iframe, do you know if this can be fixed?

    im previewing in mobile, and the image is cutting off a lot, i want the iframe to contain the image.
    im using the exact code you put in the video
     
     
    i used the exact code in your memberscript video for the iframe but it would overflow within the iframe, ideally i want it to contain the entire image and show it as the placeholder i have on the page
     
    i tried changing the iframe code to:
    <iframe ms-code-field-link="missing-pet-flyer" style="width: 100%; height: 100%; border: none; overflow: hidden;" src=""></iframe>
    to try and fix it, but still shows contained within the iframe
     
    any help is greatly appreciated 🙂
    0
  • Comment author
    Julian Galluzzo

    So this would be on the side of the iframed image itself - if it's set to a fixed width of, say, 1000px - there's nothing we can do here. that image will need to be set to a responsive value for it to inherit the width of the elemtn its iframed in

    0
  • Comment author
    webflow pro guy

    okay thank you Julian!

    just as an fyi, i decided to host the image on the collection page, by sending the image url file to webflow through make.

    that way i can just use an image element that pulls from webflow - iframe was confusing the hell out of me haha

    0
  • Comment author
    Duncan from Memberstack

    Hey webflow pro guy 👋

    Try changing the attribute to data-ms-member="image-url"

    0
  • Comment author
    Max Bramwell

    Hi all, anyone know if you can show/run script on a website just to paid members? Maybe using the 'data-ms-content="paid-plans"'

    0
  • Comment author
    Chukwudi Onyekwere

    Hi Max,

    I'm not sure I understand what you're trying to achieve but if you're looking for a script for your website that should display something for users on a paid plan, then the script below would work. However, if this isn't what you mean, please provide more details of what you want.

    <script>
    window.$memberstackDom.getCurrentMember().then((member) => {
    if (member) {
    const planConnections = member.data["planConnections"];
    if (planConnections && planConnections.length > 0) {
    let hasPaidPlan = false;

    for (const plan of planConnections) {
    if (plan.type !== "FREE") {
    hasPaidPlan = true;
    break;
    }
    }

    if (hasPaidPlan) {
    // Display something
    console.log("has paid plan”);

    }
    }
    }
    });
    </script>
    0

Please sign in to leave a comment.