Changed image path

Hi, i have two pages, home and note, in these pages i use same snippet. but image path <img class="SVG" src="assets/images/bicisim-logo.svg" width="152" height="45"/> like this. it works in the home page. but in the note page, trying to fetch in this url
note/assets/images/bicisim-logo.svg. how can i fix it?

You have used a relative path, you should use an absolute one.

src="/assets/images/bicisim-logo.svg"

Alternatively, you can use the `asset() helper, which also allows you to make sure the file exists before you output the image tag:

<?php
\$asset = asset('assets/images/bicisim-logo.svg');
if (\$asset->exists()): ?>
<img class="SVG" src="<?= \$asset->url() ?>" width="152" height="45"/>
<?php endif ?>
2 Likes