Hi all,
I'm working on a function that outputs markup for a bootstrap 3 carousel.
I'm passing the $page->images object to the function argument $images.
To have an individual id for each carousel on a page with multiple carousels, I want to use the image field id and the page id of the page were the image field sits.
I can get the image field id with:
$images->field->id
But I can't seem to get the page id although it's there in the var_dump of the $images object:
object(Pageimages)[203]
protected 'page' =>
object(Page)[206]
protected 'template' =>
...
protected 'settings' =>
array (size=10)
'id' => int 1013 //this is the id I need
...
protected 'field' =>
object(Field)[72]
protected 'settings' =>
array (size=5)
'id' => int 100 //this one I can get with $images->field->id
...
When I try
$images->page->settings->id
I get null.
When I try
$images->page->id
I get 1012 instead of 1013. 1012 is nowhere to be found in the $images object. It is the id of the page from which I'm calling my function. But I'm not passing the $page object to my function.
So where does it come from and how can I get the correct page id?
Thanks for reading through this!