code: protected boolean isValidDetailPage(CmsObject cms, CmsResource page, CmsResource detailRes) {
  
          if (OpenCms.getSystemInfo().isRestrictDetailContents()) {
              // in 'restrict detail contents mode', do not allow detail contents from a real site on a detail page of a different real site
              CmsSite pageSite = OpenCms.getSiteManager().getSiteForRootPath(page.getRootPath());
              CmsSite detailSite = OpenCms.getSiteManager().getSiteForRootPath(detailRes.getRootPath());
              if ((pageSite != null)
                  && (detailSite != null)
                  && !pageSite.getSiteRoot().equals(detailSite.getSiteRoot())) {
                  return false;
              }
          }
          return OpenCms.getADEManager().isDetailPage(cms, page);
      }
docs: Checks whether the given detail page is valid for the given resource.<p>
  
  @param cms the CMS context
  @param page the detail page
  @param detailRes the detail resource
  
  @return true if the given detail page is valid