Trying to output path for custom template for the Image block

I'm playing round with the image block, trying to duplicate a custom template I built previously that allowed me to pass the path to backstretch to add a full screen background image to my page.

I can't seem to output the path using the variables that are already listed in the core image block and I can't find anywhere in the forums which outlines how to do this.

This is what I've stripped the core image code back to:
<?php defined('C5_EXECUTE') or die("Access Denied.");
$c = Page::getCurrentPage(); {
    $image = Core::make('html/image', array($f));
    $tag = $image->getTag();
    $.backstretch("<?php print $tag;?>");

and this is what it renders:
    $.backstretch("<img src="/concrete5.7.2.1/application/files/7414/2049/5444/nature-walk-resized.jpg" alt="nature-walk-resized.jpg" width="1000" height="667">");

Can anyone help me out and let me know what I need to call to be able to output the path without the html that wraps it.

View Replies:
MrKDilkington replied on at Permalink Reply
Hi C5ThemeTeam,

There isn't a lot of documentation on image use in 5.7 yet.

In the meantime, you can use Core::make('helper/image') like 5.6's Loader::helper(‘image’). It has been removed from legacy - .

This allows you to use getThumbnail() and imagename->src.

Also, I am finishing a block that does this exact thing, but without JavaScript or jQuery dependency. It also supports full screen background images on older browsers (using JavaScript).

I imagine this free block will be ready in the marketplace in a week or two.
C5ThemeTeam replied on at Permalink Reply
Thanks a million for answering so quickly. I'll look at this again today
OnsiteDesigner replied on at Permalink Reply
Hi it's probably too late now, but incase anyone else wants it... I have managed to extract just the path using:

$image = Core::make('html/image', array($f));
$imagePath = $image->getTag()->src;
tduncandesign replied on at Permalink Reply
Very helpful, thanks for posting.