code: private String getParentContainerId(Element elem) {
  
          String attr = CmsContainerPageContainer.PROP_CONTAINER_MARKER;
          Element lastElem;
          do {
              String propValue = elem.getPropertyString(attr);
              if (!CmsStringUtil.isEmptyOrWhitespaceOnly(propValue)) {
                  return propValue;
              }
              lastElem = elem;
              elem = elem.getParentElement();
          } while ((elem != null) && (elem != lastElem));
          return null;
      }
docs: Gets the container id of the most deeply nested container containing the given element, or null if no such container can be found.<p>
  
  @param elem the element
  @return the container id of the deepest container containing the element