code: public static String getDetailType(CmsObject cms, CmsResource detailPage, CmsResource parentFolder) {
  
          String type = null;
          try {
              if (OpenCms.getADEManager().isDetailPage(cms, detailPage)) {
                  List<CmsDetailPageInfo> detailPages = OpenCms.getADEManager().getAllDetailPages(cms);
                  if (parentFolder == null) {
                      parentFolder = cms.readParentFolder(detailPage.getStructureId());
                  }
                  for (CmsDetailPageInfo info : detailPages) {
                      if (info.getId().equals(detailPage.getStructureId())
                          || info.getId().equals(parentFolder.getStructureId())) {
                          type = info.getType();
                          if (type.startsWith(CmsDetailPageInfo.FUNCTION_PREFIX)) {
                              type = CmsXmlDynamicFunctionHandler.TYPE_FUNCTION;
                          }
                          break;
                      }
                  }
              }
          } catch (CmsException e) {
              // parent folder can't be read, ignore
          }
          return type;
      }
docs: Returns the detail content type for container pages that may be detail pages.<p>
  
  @param cms the cms context
  @param detailPage the container page resource
  @param parentFolder the parent folder or <code>null</code>
  
  @return the detail content type