uzlander Posted December 3, 2023 Share Posted December 3, 2023 Hi everyone! I admit it sounds a bit silly, but i can't do simply <img src="<?=$config->images_path.'pw3.png';?>" alt='pw-logo'> ($config->images_path i've defined in my config.php, it points correct). On the page it shows alt text though. What am i missing ? ? Link to comment Share on other sites More sharing options...
bernhard Posted December 3, 2023 Share Posted December 3, 2023 The "correct output" you are showing is an absolute file path. On websites in the <img> tag you need an url relative to your site's root folder. That would typically be something like /site/templates/img/foo.jpg Not sure why your path shows "site-news" instead of just "site" though. Link to comment Share on other sites More sharing options...
uzlander Posted December 4, 2023 Author Share Posted December 4, 2023 3 hours ago, bernhard said: Not sure why your path shows "site-news" instead of just "site" though. This is a copy of the original site folder in my processwire installed, experimenting with the copy )) Link to comment Share on other sites More sharing options...
uzlander Posted December 4, 2023 Author Share Posted December 4, 2023 Yeah, seems like i need to refresh my knowledge on php fundamentals, much thankful for rapid help !:) Corrected: <img src="<?=$config->images_url.'logo.png';?>" alt=""> with corresponding line in config.php: $config->images_url = $config->urls->templates.'images/'; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now