Can I hide a CMS item (not collection) after an action?

Hey all,

Loving Memberstack so far. I have a website that allows users to book travel activities. I have a ‘book now’ button displayed for premium members. Once they book their activity, I would like to hide the activity to the member so that they can’t rebook. To do this I would either need to hide the CMS item or the ‘book now’ button (just for that member).

Does Memberstack allow anything like this yet?

Thanks :slight_smile:

1 Like

Hey @lundberg! I actually want this same functionality for a MemberStack.io page I’m working on.

It requires a bit of custom code and member metadata to “remember” that a user clicked on a button and then to hide/disable the button.

I’ll follow up when we have something working. Maybe another community member already has some code to share.

2 Likes

Ah this is good to know. Please update me when you have a solution!

As a side-issue, I’d love to display the activities booked by a user in their dashboard. I’ve seen that I can have user-specific dashboards, but is there any way to display activities booked (I would register that a user has booked an activity when they click ‘confirm’ on a booking).

Either way I’m super excited for the future of Memberstack :smiley:

1 Like

My site records and displays a user’s activities. It updates a log when the user downloads a document or emails a document. I use MemberStack’s metadata to log the activity. For example, when a user clicks a download button, I add downloading information to an array in metadata. Here is example code for logging downloads.

MemberStack.onReady.then(async function(member) {
var metadata = await member.getMetaData()

if (!metadata.Downloads) {
	var memberActions = {
		Downloads: []
	}
	member.updateMetaData(memberActions)
}
metadata.Downloads.push({
	createdate: createDate,
	filename: attachmentName
});	
member.updateMetaData(metadata);})

For retrieving the download activity to display on the user’s dashboard, I use the following to get the contents of the Downloads array (which I then parse and display in a table on the dashboard).

MemberStack.onReady.then(async function(member) {
	var metadata = await member.getMetaData()
	var downloadData = metadata.Downloads;
	//Then parse downloadData and display the contents in the dashboard
})
3 Likes

Thanks Scott, this is fascinating. I’m not much of a developer but I’m going to investigate and see what I can do with a friend of mine. Thanks so much!

1 Like