#1 June 6, 2019 11:08am

Scarfex
Member
Registered: January 4, 2019
Posts: 14

How to call cropped images to front end

Hi, im a bit stuck with this, im uploading images to a matrix with image presets the crop the images but when i call the item in the front end the images show up as the originals without being cropped. plz help thanks

Offline

#2 June 6, 2019 11:32am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 903

Re: How to call cropped images to front end

Use the BigTree::prefixFile method to append the crop prefix to the filename to draw your crop rather than your default image.

Offline

#3 June 6, 2019 1:55pm

Scarfex
Member
Registered: January 4, 2019
Posts: 14

Re: How to call cropped images to front end

Hi im not sure how to use the prefix function, can you give me an example?

for reference...this is a snippet of the code im trying to use it for, where $item["thumb"] is the picture an i've used the prefix "low".
        <? foreach ($portfolio_info as $item) { ?>
            <div class="col-md-4">
              <img src="<?=$item["thumb"]?>">
            </div>
        <? } ?>
</div>

Thank you

Offline

#4 June 6, 2019 3:04pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 903

Re: How to call cropped images to front end

        <? foreach ($portfolio_info as $item) { ?>
            <div class="col-md-4">
              <img src="<?=BigTree::prefixFile($item["thumb"], "low")?>">
            </div>
        <? } ?>

Offline

#5 June 6, 2019 4:18pm

Scarfex
Member
Registered: January 4, 2019
Posts: 14

Re: How to call cropped images to front end

Thanks alot it worked perfectly!

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.