Skip to content

Static images in dev-server mode #78

Answered by kszymukowicz
kszymukowicz asked this question in Q&A
Discussion options

You must be logged in to vote

After great support of @sabbelasichon the solution is simple.

Just use VH encore:asset

<f:image src="{encore:asset(pathToFile: 'EXT:local/Resources/Public/Frontend/images/content/image-logo-200-150.png')}"

and this produces

<img class="img-responsive" alt="Home" src="https://example.ddev.site:8080/typo3conf/ext/local/Resources/Public/Frontend/images/content/image-logo-200-150.png">

in dev-server mode
and

<img class="img-responsive" alt="Home" src="/typo3conf/ext/local/Resources/Public/Frontend/images/content/image-logo-200-150.png">

in production mode.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@kszymukowicz
Comment options

Comment options

You must be logged in to vote
1 reply
@sabbelasichon
Comment options

Answer selected by kszymukowicz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants