Show template on container

hi
i have the following yang module for my requirement for cli syntax and i want to perform show template on below model

list primary{
  key Id;
  leaf id{
    type string;
  }
  leaf name{
    type string;
  }
  container secondary{
    leaf id{
      type leafref{
        path "/primary/id";
      }
    }
  }
}

actually i need to access id leaf from both container and list wen i do show on it.
example

show primary 
id:xxxxxx
name:xxxxx
show primary secondary 
id:xxxxx
name:xxxxxx

is there any way so that i can obtain above behavior.

thanks

tailf:link is probably what you are looking for:

list primary {
  key Id;
  leaf id {
    type string;
  }
  leaf name {
    type string;
  }
  container secondary {
    leaf id {
      type string;                             // Same type as primary
      tailf:link "/primary[id = current()/../../id]/id"; // Get the correct instance in the list
    }
    leaf name {
      type string; // Same as primary
      tailf:link "/primary[id = current()/../../id]/name"; // Also works with non-key leafs
    }
  }
}