In Structure you can get the parent entry_id using {structure:parent:entry_id} but is there any way to get the grandparent entry_id?

1 Answer 1


I figured it out...

{exp:query sql="SELECT parent_id as grandparent_id FROM exp_structure WHERE entry_id = {structure:parent:entry_id}"}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.