1

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

2

I figured it out...

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

Your Answer

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

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