Streaming live at 10am (PST)

Using javascript to filter CMS items

I’m using memberstack with webflow. I have these projects on the dashboard, I need to filter them based on if a reference in the CMS is equal to the memberstack ID.

In simple terms: Users who log in cannot see other user’s projects (because it’s filtered by matching their user ID, through memberstack)

You can see there are 3 projects here. My user-member “ttttttttttttttttest”, is linked to the “Rezi software promotional video” project. Each user-member profile has a memberstack ID in the CMS.

image

The memberstack ID is referenced in this custom code here, inside the CMS list, referencing class “myProject”

<script>
	MemberStack.onReady.then(function(member) {
  if (member["id"] === '{{wf {&quot;path&quot;:&quot;brand-member:memberstack-id&quot;,&quot;type&quot;:&quot;PlainText&quot;\} }}' || '{{wf {&quot;path&quot;:&quot;creator-1-reference:memberstack-id&quot;,&quot;type&quot;:&quot;PlainText&quot;\} }}'){
  $('.myProject').css({'display': 'block'});
  } else {
  $('.myProject').css({'display': 'none'});
  console.log(member);
  };
});
</script>

However it’s not properly filtering. I tried to set it to member[“id”] === ‘1’ just for testing, since the memberstack ID is a long string of numbers, but it wouldn’t hide it as well. Could someone please help me understand how to filter with JS by the memberstack ID reference?


Here is my site Read-Only: LINK

hi @Evan_Joyal I do not know solution but I have found that you have broken code in page setting related to member id. You have fo fix it first or delete is if you do not use it.

CleanShot 2021-05-07 at 08.29.13