openeuropa / oe_whitelabel

European Union Public License 1.2
2 stars 4 forks source link

Proposal: Use twig filter extension for Image value object #216

Open msnassar opened 1 year ago

msnassar commented 1 year ago

Backgroup: Currently, in order to pass ImageValueObject to a pattern, you are doing preprocess to prepare the image e.g. here. I think, this is very complex and requires to do preprocess for each entity type and each image field!

Solution: To avoid all these preprocesses, I suggest to create a twig extension that converts a render array that contains ImageItem to ImageValueObject.

Example from UCPKN: Find the extension here Find usages example here

Please let me know your thoughts?

tibi2303 commented 1 year ago

Good day,

Can i have access to ucpkn repo in order to see the examples?

msnassar commented 1 year ago

@tibi2303 Sorry, I do not have the privileges to grant the access. I recommend to contact QA team...