Frontend Rendering 

TypoScript configuration for frontend image rendering, CSS classes, lazy loading, and lightbox integration.

TypoScript Configuration 

Frontend Rendering Setup 

The extension provides default configuration. You can customize it:

lib.parseFunc_RTE {
    tags.img = TEXT
    tags.img {
        current = 1
        preUserFunc = Netresearch\RteCKEditorImage\Controller\ImageRenderingController->renderImageAttributes
    }

    tags.a = TEXT
    tags.a {
        current = 1
        preUserFunc = Netresearch\RteCKEditorImage\Controller\ImageLinkRenderingController->renderImages
    }

    nonTypoTagStdWrap.HTMLparser.tags.img.fixAttrib {
        # Remove internal data attributes from frontend
        allparams.unset = 1
        data-htmlarea-file-uid.unset = 1
        data-htmlarea-file-table.unset = 1
        data-htmlarea-zoom.unset = 1
        data-htmlarea-clickenlarge.unset = 1
        data-title-override.unset = 1
        data-alt-override.unset = 1
    }
}

lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.encapsTagList := addToList(img)
Copied!

Default CSS Class 

Add default class to all RTE images:

lib.parseFunc_RTE {
    nonTypoTagStdWrap.HTMLparser.tags.img.fixAttrib.class {
        default = img-fluid responsive-image
    }
}
Copied!

Lazyload Configuration 

Enable native browser lazy loading:

Template Constants
styles.content.image.lazyLoading = lazy
# Options: lazy, eager, auto
Copied!

Static Template 

Include the static template for default TypoScript:

  1. Go to TemplateInfo/Modify
  2. Edit whole template record
  3. Go to Includes tab
  4. Add CKEditor Image Support in Include static (from extensions)
  5. ⚠️ Add it before Fluid Styled Content

TypoScript Reference 

Complete TypoScript Configuration Options 

Image Rendering 

lib.parseFunc_RTE {
    tags.img = TEXT
    tags.img {
        current = 1
        preUserFunc = Netresearch\RteCKEditorImage\Controller\ImageRenderingController->renderImageAttributes
    }
}
Copied!

HTML Parser Configuration 

lib.parseFunc_RTE.nonTypoTagStdWrap.HTMLparser.tags.img {
    fixAttrib {
        # Remove internal data attributes
        data-htmlarea-file-uid.unset = 1
        data-htmlarea-file-table.unset = 1
        data-htmlarea-zoom.unset = 1
        data-htmlarea-clickenlarge.unset = 1
        data-title-override.unset = 1
        data-alt-override.unset = 1
    }
}
Copied!

Default CSS Classes 

lib.parseFunc_RTE.nonTypoTagStdWrap.HTMLparser.tags.img.fixAttrib.class {
    default = img-fluid
    list = img-fluid,img-thumbnail,rounded
}
Copied!

Lazy Loading 

# Template Constants
styles.content.image.lazyLoading = lazy
# Options: lazy, eager, auto
Copied!

Image Processing 

lib.parseFunc_RTE.nonTypoTagStdWrap.HTMLparser.tags.img {
    width =
    height =
    # Allows TYPO3 to process dimensions
}
Copied!

Encapsulation Configuration 

lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines {
    encapsTagList := addToList(img)
    remapTag.img = p
}
Copied!