Home Joomla: How to add an article intro image to be the background of a div
Reply: 0

Joomla: How to add an article intro image to be the background of a div

jQno2
1#
jQno2 Published in 2018-02-11 13:43:58Z

I want to add the article intro image to be the background image of a div. In my layout I have the following code which assigns the image to the div with hard coded CSS but the syntax is such that the 'background URL' is closed by the close bracket at the same time the PHP code is finished, leavign code snippites and an unclosed div in the PHP.

<div style=" height:100px; width:100px; background-image: url('<?php echo JLayoutHelper::render('joomla.content.intro_image', $item); ?>');"></div>

Any help would be appreciated, I think I need to call the image another way? as at the moment this is what I have.

How it displays at the moment.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.341895 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO