?
avatar VoittajaTomi
VoittajaTomi
16 May 2017

Hello, I am working on a template somebody else has made. We have a frontpage template that shows articles introtexts & images. Since 3.7 the images are not shown.

if (isset($tag)) {
	if(strpos($tag->getAttribute('src'), "http") !== FALSE && !strpos($tag->getAttribute('src'), "www") !== FALSE) {
			echo "<img src='" . $tag->getAttribute('src') . "' alt='' />";
	} else {
			echo "<img src='" . JURI::root() . $tag->getAttribute('src') . "' alt='' />";
        }

}

It is a very hacky solution. How to properly access the first image of the article?

avatar VoittajaTomi VoittajaTomi - open - 16 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 16 May 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 16 May 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 16 May 2017
Category Templates (site)
avatar brianteeman brianteeman - change - 19 May 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-05-19 17:27:07
Closed_By brianteeman
avatar brianteeman brianteeman - close - 19 May 2017
avatar brianteeman
brianteeman - comment - 19 May 2017

Please ask this question on the forum https://forum.joomla.org OR on the mailing list https://groups.google.com/forum/#!forum/joomla-dev-general

Add a Comment

Login with GitHub to post a comment