Skip to content

Enhance ImageViewHelper to support additional attributes#91

Closed
georgringer wants to merge 1 commit intob13:masterfrom
georgringer:patch-1
Closed

Enhance ImageViewHelper to support additional attributes#91
georgringer wants to merge 1 commit intob13:masterfrom
georgringer:patch-1

Conversation

@georgringer
Copy link
Copy Markdown
Contributor

If argument loading is provided, always load it

and also add all others in 14

If argument loading is provided, always load it

and also add all others in 14
@bmack bmack requested a review from achimfritz March 14, 2026 22:20
@achimfritz achimfritz requested review from achimfritz and removed request for achimfritz March 19, 2026 16:07
// override if set
if (isset($this->additionalArguments['loading'])) {
$tag->addAttribute('loading', $this->additionalArguments['loading']);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @georgringer , this should already be added 3 lines above:

                if ($this->pictureConfiguration->lazyLoadingShouldBeAdded()) {
                    $tag->addAttribute('loading', $this->pictureConfiguration->getLazyLoading());
                }

doesn' t that work?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@achimfritz no as I need most of the teams lazy which is fine but on some hero elements I need eager

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should work already, we use this all the time, like this:

<i:image class="b_startpage-header__background" pictureClass="b_startpage-header__background-picture"
	src="{images.0.uid}" treatIdAsReference="1"
	width="375c" height="307c"
	sources="{
		xl: {width: '1920c', height: '711c', cropVariant: 'md'},
		lg: {width: '1439c', height: '533c', cropVariant: 'md'},
		md: {width: '1279c', height: '474c', cropVariant: 'md'},
		sm: {width: '799c', height: '655c'},
		xs: {width: '767c', height: '629c'}
	}" loading="eager"
/>

achimfritz added a commit that referenced this pull request Apr 23, 2026
achimfritz added a commit that referenced this pull request Apr 23, 2026
@achimfritz achimfritz mentioned this pull request Apr 23, 2026
achimfritz added a commit that referenced this pull request Apr 24, 2026
@achimfritz
Copy link
Copy Markdown
Contributor

Hi @georgringer , i close this PR, we released 4.0.0, and there is a test s. 5760526 , if any problems exists, please create another issue.

@achimfritz achimfritz closed this Apr 24, 2026
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.

3 participants