How to use the scrivito.currentPage function in scrivito

To help you get started, we’ve selected a few scrivito examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Scrivito / scrivito_example_app_js / src / Components / Navigation / currentPageNavigationOptions.js View on Github external
function currentPageNavigationOptions() {
  if (Scrivito.currentPage()) {
    switch (Scrivito.currentPage().objClass()) {
      case "Blog":
        return blogNavigationOptions(Scrivito.currentPage());
      case "BlogPost":
        return blogPostNavigationOptions(Scrivito.currentPage());
      case "Event":
        return eventNavigationOptions(Scrivito.currentPage());
      case "Homepage":
        return homepageNavigationOptions(Scrivito.currentPage());
      case "Job":
        return jobNavigationOptions(Scrivito.currentPage());
      case "LandingPage":
        return landingPageNavigationOptions(Scrivito.currentPage());
      case "Page":
        return pageNavigationOptions(Scrivito.currentPage());
      case "SearchResults":
        return searchResultsNavigationOptions(Scrivito.currentPage());
      default:
        break;
    }
  }

  return {
    navigationStyle: "solidWhite",
    backgroundImage: null,
    heightClassName: null,
    isLandingPage: false,
    useGradient: false,
  };
github Scrivito / scrivito_example_app_js / src / Components / Navigation / NavigationSection.js View on Github external
function NavigationSection({ heightClassName }) {
  if (!["full-height", "medium-height"].includes(heightClassName)) {
    return null;
  }

  if (!Scrivito.currentPage()) {
    return null;
  }
  const obj = Scrivito.currentPage();
  if (!obj.get("navigationSection")) {
    return null;
  }

  return (
    
  );
}
github Scrivito / scrivito_example_app_js / src / Components / Navigation / NavChild.js View on Github external
function isActive(page) {
  if (!Scrivito.currentPage()) {
    return false;
  }

  const currentPath = Scrivito.currentPage().path();
  if (currentPath) {
    return currentPath.startsWith(page.path());
  }

  if (Scrivito.currentPage().objClass() === "BlogPost") {
    return page.objClass() === "Blog";
  }

  return false;
}
github Scrivito / scrivito_example_app_js / src / Components / Navigation / currentPageNavigationOptions.js View on Github external
function currentPageNavigationOptions() {
  if (Scrivito.currentPage()) {
    switch (Scrivito.currentPage().objClass()) {
      case "Blog":
        return blogNavigationOptions(Scrivito.currentPage());
      case "BlogPost":
        return blogPostNavigationOptions(Scrivito.currentPage());
      case "Event":
        return eventNavigationOptions(Scrivito.currentPage());
      case "Homepage":
        return homepageNavigationOptions(Scrivito.currentPage());
      case "Job":
        return jobNavigationOptions(Scrivito.currentPage());
      case "LandingPage":
        return landingPageNavigationOptions(Scrivito.currentPage());
      case "Page":
        return pageNavigationOptions(Scrivito.currentPage());
      case "SearchResults":
        return searchResultsNavigationOptions(Scrivito.currentPage());
      default:
        break;
github Scrivito / scrivito_example_app_js / src / Components / Navigation / Search.js View on Github external
export const SearchIcon = Scrivito.connect(({ toggleSearch }) => {
  if (
    Scrivito.currentPage() &&
    Scrivito.currentPage().objClass() === "SearchResults"
  ) {
    return (
      <span>
        <i aria-hidden="true">
      </i></span><i aria-hidden="true">
    );
  }

  return (
    <span>
      <i aria-hidden="true">
    </i></span><i aria-hidden="true">
  );
});
</i></i>
github Scrivito / scrivito_example_app_js / src / Components / Navigation / currentPageNavigationOptions.js View on Github external
function currentPageNavigationOptions() {
  if (Scrivito.currentPage()) {
    switch (Scrivito.currentPage().objClass()) {
      case "Blog":
        return blogNavigationOptions(Scrivito.currentPage());
      case "BlogPost":
        return blogPostNavigationOptions(Scrivito.currentPage());
      case "Event":
        return eventNavigationOptions(Scrivito.currentPage());
      case "Homepage":
        return homepageNavigationOptions(Scrivito.currentPage());
      case "Job":
        return jobNavigationOptions(Scrivito.currentPage());
      case "LandingPage":
        return landingPageNavigationOptions(Scrivito.currentPage());
      case "Page":
        return pageNavigationOptions(Scrivito.currentPage());
      case "SearchResults":
github Scrivito / scrivito_example_app_js / src / Components / Navigation / NavChild.js View on Github external
function isActive(page) {
  if (!Scrivito.currentPage()) {
    return false;
  }

  const currentPath = Scrivito.currentPage().path();
  if (currentPath) {
    return currentPath.startsWith(page.path());
  }

  if (Scrivito.currentPage().objClass() === "BlogPost") {
    return page.objClass() === "Blog";
  }

  return false;
}
github Scrivito / scrivito_example_app_js / src / Components / Navigation / NavChild.js View on Github external
function isActive(page) {
  if (!Scrivito.currentPage()) {
    return false;
  }

  const currentPath = Scrivito.currentPage().path();
  if (currentPath) {
    return currentPath.startsWith(page.path());
  }

  if (Scrivito.currentPage().objClass() === "BlogPost") {
    return page.objClass() === "Blog";
  }

  return false;
}
github Scrivito / scrivito_example_app_js / src / Components / Navigation / currentPageNavigationOptions.js View on Github external
case "Blog":
        return blogNavigationOptions(Scrivito.currentPage());
      case "BlogPost":
        return blogPostNavigationOptions(Scrivito.currentPage());
      case "Event":
        return eventNavigationOptions(Scrivito.currentPage());
      case "Homepage":
        return homepageNavigationOptions(Scrivito.currentPage());
      case "Job":
        return jobNavigationOptions(Scrivito.currentPage());
      case "LandingPage":
        return landingPageNavigationOptions(Scrivito.currentPage());
      case "Page":
        return pageNavigationOptions(Scrivito.currentPage());
      case "SearchResults":
        return searchResultsNavigationOptions(Scrivito.currentPage());
      default:
        break;
    }
  }

  return {
    navigationStyle: "solidWhite",
    backgroundImage: null,
    heightClassName: null,
    isLandingPage: false,
    useGradient: false,
  };
}
github Scrivito / scrivito_example_app_js / src / Components / Navigation / currentPageNavigationOptions.js View on Github external
if (Scrivito.currentPage()) {
    switch (Scrivito.currentPage().objClass()) {
      case "Blog":
        return blogNavigationOptions(Scrivito.currentPage());
      case "BlogPost":
        return blogPostNavigationOptions(Scrivito.currentPage());
      case "Event":
        return eventNavigationOptions(Scrivito.currentPage());
      case "Homepage":
        return homepageNavigationOptions(Scrivito.currentPage());
      case "Job":
        return jobNavigationOptions(Scrivito.currentPage());
      case "LandingPage":
        return landingPageNavigationOptions(Scrivito.currentPage());
      case "Page":
        return pageNavigationOptions(Scrivito.currentPage());
      case "SearchResults":
        return searchResultsNavigationOptions(Scrivito.currentPage());
      default:
        break;
    }
  }

  return {
    navigationStyle: "solidWhite",
    backgroundImage: null,
    heightClassName: null,
    isLandingPage: false,
    useGradient: false,
  };
}

scrivito

Scrivito is a professional, yet easy to use SaaS Enterprise Content Management Service, built for digital agencies and medium to large businesses. It is completely maintenance-free, cost-effective, and has unprecedented performance and security.

LGPL-3.0
Latest version published 24 days ago

Package Health Score

68 / 100
Full package analysis