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

[Feature Request] Crop-Variants #89

Open
kitzberger opened this issue Sep 29, 2021 · 3 comments
Open

[Feature Request] Crop-Variants #89

kitzberger opened this issue Sep 29, 2021 · 3 comments

Comments

@kitzberger
Copy link
Contributor

Thanks for creating an awesome tool!

We've managed to successfully implement the first components but are kinda stuck now ;-/ We're wondering whether or not it's possible with the current Image model to use cropVariants that work not only when implemented in TYPO3 templates but also within the styleguide (with fixtures)?

Any help's apprecciated! Please let us know if (and to be honest how) we can provide a patch that enhances the current model ;-)

@kitzberger
Copy link
Contributor Author

Currently we're having this image atom here:

<fc:component>
    <fc:param name="image" type="Image" />
    <fc:param name="maxWidth" type="integer" />
    <fc:param name="cropVariant" type="string" />

    <fc:renderer>
        <f:if condition="{image.type} == 'LocalImage'">
            <f:then>
                <f:comment>Styleguide, without support for cropping variants (but maxWidth is working!)</f:comment>
                <f:image src="{image}" maxWidth="{maxWidth}" alt="{image.alternative}" />
            </f:then>
            <f:else>
                <f:comment>Actual fluid templating: with support for cropping variants!</f:comment>
                <f:image image="{image.file}" maxWidth="{maxWidth}" cropVariant="{cropVariant}" />
            </f:else>
        </f:if>
    </fc:renderer>
</fc:component>

The discepency between image="{image}" and image="{image.file}" is no typo!

The fixture looks like this:

    "image": {
      "file": "EXT:my_extension/Resources/Public/Images/styleguide/a-dummy-image.jpg",
      "alternative": "This is an image alt text"
    }

@s2b
Copy link
Collaborator

s2b commented Mar 16, 2023

Yes, we use a similar approach (or rather workaround) in our projects. We are still working on a separate extension that will cover the whole responsive images subject (as well as other media files). However, it's not ready yet because we are busy with project work.

I'll check internally if we can publish a draft, so that you can check the current development status (and maybe also participate? :))

@s2b
Copy link
Collaborator

s2b commented Mar 16, 2023

Ok, you can have a look here: https://github.com/sitegeist/media-components

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

No branches or pull requests

2 participants