Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added member labels to template options #15430

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tomwadley
Copy link

Being able to access a member's labels from the theme template allows customizing the user experience based on the type of member.

Trivial example:

{{#foreach @member.labels}}
    {{#match name "=" "vip"}}
        Thanks for being a VIP!
    {{/match}}
{{/foreach}}

I think there are many potential use cases that would be enabled by allowing labels to be used like this. For example, you could build a simple tier-like system (separate to the existing Stripe tier system) that hides certain post's content based on a member's tier label.

If we're happy exposing labels to theme templates, a useful next step could be adding label support to the has handlebars helper to make it easier to query whether or not a member has a given label.

no issue
Being able to access a member's label from the theme template allows customizing the content based on the type of member.
@ErisDS ErisDS self-requested a review October 2, 2022 08:43
@ErisDS
Copy link
Member

ErisDS commented Oct 3, 2022

Thanks for this PR - I totally agree with this change in principle.

However, this change is ringing an alarm bell for me because it touches the one place in the code where the theme API isn't directly pulling from the Content API and we haven't got any clear pattern or defined rules here - as you can see it's just a random made up JS object 😬

I'm slightly concerned about expanding it to include more stuff, when it's not clear what it is and whether it should be public info. Lemme have a little think on this and a chat with the engineers who know the code best, and figure if this is is defo safe to expose.

@ErisDS ErisDS added the investigating Issues where the cause is unclear label Oct 3, 2022
@ErisDS ErisDS self-assigned this Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating Issues where the cause is unclear
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants