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

IBX-7276: Extended built-in Twig functions library #301

Merged
merged 5 commits into from
Dec 4, 2023
Merged

Conversation

adamwojs
Copy link
Member

@adamwojs adamwojs commented Dec 3, 2023

Question Answer
JIRA issue IBX-7276
Type feature
Target Ibexa version v4.6
BC breaks no

ibexa_has_field

ibexa_has_field Twig function allows check if content contains given field:

{% if ibexa_has_field(content, 'foo') %}
    {{ ibexa_render_field(content, 'foo') }}
{% endif %}

ibexa_field_group_name

ibexa_field_group_name Twig function return human-readable field group name:

{{ ibexa_field_group_name('content') }}

ibexa_is_current_user

ibexa_is_current_user Twig function check if given user is current repository user:

{% if ibexa_is_current_user(version_info.author) %}
    <!-- display edit link -->
{% endif %}

ibexa_get_current_user

ibexa_get_current_user Twig function returns current repository user:

Current user: {{ ibexa_get_current_user().login }}

Checklist:

  • Provided PR description.
  • Tested the solution manually.
  • Provided automated test coverage.
  • Checked that target branch is set correctly (main for features, the oldest supported for bugs).
  • Ran PHP CS Fixer for new PHP code (use $ composer fix-cs).
  • Asked for a review (ping @ibexa/engineering).

@adamwojs adamwojs changed the title IBX-7276: Added ibexa_has_field Twig function IBX-7276: Added ibexa_has_field / ibexa_field_group_name Twig functions Dec 3, 2023
@adamwojs adamwojs changed the title IBX-7276: Added ibexa_has_field / ibexa_field_group_name Twig functions IBX-7276: Extended built-in Twig functions library Dec 3, 2023
Copy link

sonarqubecloud bot commented Dec 3, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
4.3% 4.3% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@adamwojs adamwojs requested a review from a team December 4, 2023 06:38
@konradoboza konradoboza requested a review from a team December 4, 2023 09:27
@adamwojs adamwojs added the Doc needed The changes require some documentation label Dec 4, 2023
@adamwojs adamwojs merged commit 42f3f9d into main Dec 4, 2023
21 of 22 checks passed
@adamwojs adamwojs deleted the ibexa_has_field branch December 4, 2023 14:54
@dabrt dabrt self-assigned this Dec 4, 2023
@dabrt dabrt removed the Doc needed The changes require some documentation label Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants