Forum
Client wants to create members
I'm a bit of a members app newbie so forgive me if this is a daft question…
My client would like to create members. Can I do this with a multiple item region (in Perch, rather than a collection in Runway), where each member is an item in the region? Each member would then log in and only see their item's content. Is that possible?
Thanks,
Martin.
You need to create the members themselves inside the Members app.
Once you've done that you can tag content and tag members, and then only display when the tags match.
Ah, cool. So if I make an editable slug based on the title of the member item, they can copy that into the member's profile in the member's app as a tag. Thanks :)
I'm doing this in my template:
It's not outputting 'test' if the slug matches the member's tag though. Guess it's because I'm not allowed to nest
perch:content
tags. How do I get it to set the slug/tag match on a per-member basis?I guess what I'm asking is: is there a way to pass the value of
id="slug"
into thehas-tag
attribute?I've just tried this tack, but it's (probably unsurprisingly) not working:
Set values:
pull slug out of the first template and pass it into second template:
Output the variable in the second template:
The
perch:member
tags get parsed beforeperch:content
tags, so that won't work.To make it dynamic like that, you'll need to test in the page, and then either conditionally show the region, or pass a var into the template that you can use to test whether parts of the template should be displayed.
I've had a delve and I think this sort of thing is what I'm looking to do:
Then
But that won't work as it's not proper perch syntax. What do you think I should do?
I've got another system where I have to add the clients for my client like this:
But I really need to keep out of the loop on this one as the client who this new project is for will be adding loads of their clients to the members area.
You shouldn't need to do that at all. In the simplest terms, what are you trying to do?
Haha yeah, maybe I'm overcomplicating things :) I'd like my client to add an item to a region and to take the slug from that region and assign it as a tag to a member, so that that member can see that item's content when they log in
So both the tags on the content and the tags on the member are essentially unknown?
That's right
And the region contains multiple items, some which might match the user's tags, and some that might not?
That's right – so a user can only see their company's content
I think they way to do this might be to use an
each
callback to test the tagsHi Drew, got it! Here's what I'm doing:
and then
<perch:if exists="display" >
in the template to show the content of the item.Thanks very much :)
Great!