Jump to content

Resize image on onepager with child page templates


ank
 Share

Recommended Posts

Hi i'am trying to resize a image from a child page who has his own template:

 

on the home page i render all the child pages who have there own php template:

foreach($page->children() as $section){
echo $section->render();
};

On the child page the php contains:

$image = $page->image;
$thumb = $image->size(300, 150);
echo <img src='$thumb->url'>;

the $thumb is not generated and i get a error:
"Look out… Fatal Error: Uncaught Error: Call to a member function size() on null in site/templates/welcome.php:23" 
"welcome.php" is a child template.

when i use :

echo <img src='$page->image->url'>;

it display the image.

 

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...