Skip to content

Instantly share code, notes, and snippets.

@akamola

akamola/grandparent.php

Last active Nov 5, 2016
Embed
What would you like to do?
MODX: Snippet to get the ID of the grandparent resource (see: http://goo.gl/prdscX)
<?php
$id = $modx->resource->get('id');
$parents = $modx->getParentIds($id, 2);
$grandparent = $parents[1];
return $grandparent;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.