Skip to content

Conversation

AntePrkacin
Copy link

Added configuration for download_link and download_inline target types to content_view.yaml file.

Added templates for them under themes/app/content/views folder. The ezbinaryfile_common.html.twig template will be rendered when contentTypeIdentifier is either ng_video or file, and for everything else, a download_inline.html.twig or download_link.html.twig will be rendered, depending on if the target type is 'download_inline' or 'download_link'.

This PR is related to another PR opened for ibexa-fieldtype-enhanced-link bundle: netgen/ibexa-fieldtype-enhanced-link#32

… new templates for it to support 'download_link' target on enhancedlink field
…wo new templates for it to support 'download_inline' target on enhancedlink field
@AntePrkacin AntePrkacin self-assigned this Jul 9, 2025
@@ -1,4 +1,4 @@
{# content \Netgen\IbexaSiteApi\API\Values\Content #}
{# content \Ibexa\Contracts\Core\Repository\Values\Content\Content #}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this change is correct? We don't work with Ibexa Content.

Copy link
Author

@AntePrkacin AntePrkacin Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

30358e1
My bad, reverted the change here

{# content \Netgen\IbexaSiteApi\API\Values\Content #}
{# location \Netgen\IbexaSiteApi\API\Values\Location #}

{% set ezBinaryFileField = null %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Twig variables should be snake_case.

Copy link
Author

@AntePrkacin AntePrkacin Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dd4ee2b
Changed variable names to be snake_case

template: "@ibexadesign/content/views/download_inline/ezbinaryfile_common.html.twig"
match:
Identifier\ContentType:
- ng_video
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we want downloadable ng_video?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't come up with a specific use case, but I added ng_video because both file and ng_video content types have field of type ezbinaryfile.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pspanja WDYT?

template: "@ibexadesign/content/views/link_embed.html.twig"
match: ~
download_inline:
ezbinaryfile_common:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just name this common. No need for ezbinaryfile_ prefix. Same goes for template file names.

Copy link
Author

@AntePrkacin AntePrkacin Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a77e69a
Renamed ezbinaryfile_common.html.twig templates to just be common.html.twig. Updated the content_view.yaml file to reflect this change as well

@AntePrkacin AntePrkacin force-pushed the NGSTACK-921-enhanced-link-download-support branch from 5a410b5 to 30358e1 Compare July 11, 2025 08:59
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.

2 participants