[[!UltimateParent? &toplevel=`3`]]
<img src="[[!UltimateParent? &toplevel=`3`:notequalto=`73`:then=`[[*product_image:phpthumbof=`w=412&h=440&zc=1`]]`:else=`[[*product_image:phpthumbof=`w=412&h=440&zc=1`]]`]]" alt="[[*alias]]" />
This question has been answered by robh76. See the first response.
I'm trying to output a specific image size based on a grandparent ID of '73'
This snippet returns the correct ID...
[[!UltimateParent? &toplevel=`3`]]
But how do I include this in an output modifier? - I thought this would work but it doesn't...
<img src="[[!UltimateParent? &toplevel=`3`:notequalto=`73`:then=`[[*product_image:phpthumbof=`w=412&h=440&zc=1`]]`:else=`[[*product_image:phpthumbof=`w=412&h=440&zc=1`]]`]]" alt="[[*alias]]">
Any help appreciated. Thanks
$id = $modx->resource->get('id'); $parents = $modx->getParentIds($id, 2); $parent = $parents[0]; return $parent;$id = $modx->resource->get('id'); $parents = $modx->getParentIds($id, 2); $grandParent = $parents[1]; return $grandParent;