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

Check if a private property of a resource is set without using it. #3289

Open
mmzeeman opened this issue Feb 6, 2023 · 0 comments
Open

Check if a private property of a resource is set without using it. #3289

mmzeeman opened this issue Feb 6, 2023 · 0 comments

Comments

@mmzeeman
Copy link
Member

mmzeeman commented Feb 6, 2023

Zotonic version

1.0.0.rc15

Description

It is sometimes handy to check if a resource has a private property set, without the ability to actually use the property.

For instance... Checking if a users has an email adres setup, so you can display a contact form. Because the email field is private it is currently not possible to write

{% if id.email %}
   {# show contact form #}
{% endif %}

(Via @DorienD)

Proposal

Add something like this:

{% if id.has_property.email %}
  {# show contact form #}
{% endif %}

To make it possible to check if a private property is set, without the possibility to actually use the property. Could also be done via a separate model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant