2
votes

I want to add class="img-responsive" to the markup of each media element of text/media content elements.

I found a corresponding section in fluid_styled_content/Resources/Private/Partials/MediaGallery.html and added the class for test: Bingo.

<f:section name="media">
    <f:media
        file="{column.media}"
        width="{column.dimensions.width}"
        height="{column.dimensions.height}"
        alt="{column.media.alternative}"
        title="{column.media.title}"
        additionalConfig="{settings.media.additionalConfig}"
        class="img-responsive"
    />
</f:section>

I guess adding a custom partialRootPath with lib.fluidContent.partialRootPaths.200 and copying all the partials would work as documented.

However, I'd like to avoid copying 20 partials from fluid_styled_content just to change one line in one file.

Can I override a single partial of TYPO3 fluid_styled_content, or even better a single section of the partial?

Using TYPO3 7.6

1

1 Answers

4
votes
  1. Set lib.contentElement.partialRootPaths.200 = EXT:your_extension_key/Resources/Private/Partials/ in TypoScript as described in the question.
  2. Copy a single partial file MediaGallery.html from fluid_styled_content to EXT:your_extension_key/Resources/Private/Partials/
  3. Have enough breaks during work to avoid stackoverflow.