code: public static HierarchicalConfiguration getCurrentConfig() {
          SiteContext siteContext = SiteContext.getCurrent();
          if (siteContext != null) {
              return siteContext.getConfig();
          } else {
              return null;
          }
      }
docs: Returns the configuration from the current site context.