Hey Dimmy,
I’ll try and explain a little more, I think we are crossing wires
I am currently using @inherit and it works fine, but I need to define the top level of the branch so that I can link back to it. This is OK for as long as I’m doing it...I set the TV in the top level of the branch to it’s ID and leave all the others at their default value (@inherit) That way no matter where I am in the branch the TV will always point to the top of the branch. (Pretty much like using SectionRoots where I define it up front).
The question is what happens when my client needs to create a new branch...If they don’t set the TV of the top document manually....none of the @inherits will work, because it hasn’t been defined anywhere at all, thus breaking all my links. The same problem is with SectionRoots, they need to add the docId to the array when calling the snippet.
For this reason I need a way to automatically define the TV if the parent docs TV isn’t set yet (Then I know i’m at the top of the branch) so I need something along the lines of
Pseudo-code:
@EVAL
if isset($modx->[*parent*][myTemplateVariable]){
@inherit
}else{
myTemplateVariable=$modx->docId
};
Thanks again for all your help so far!
Taff