How to use the scrivito.Obj 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 / Objs / SearchResults / SearchResultsComponent.js View on Github external
calculateResults() {
    if (!this.props.params.q) {
      return {
        searchResults: [],
        totalCount: 0,
        tags: [],
      };
    }

    let search = Scrivito.Obj.where(
      "*",
      "containsPrefix",
      this.props.params.q
    ).andNot("_objClass", "equals", blacklistObjClasses);

    // make sure, that tags are calculated _before_ limiting to specific tag.
    const tags = search.facet("tags").map(tag => tag.name());

    if (this.props.params.tag) {
      search = search.and("tags", "equals", this.props.params.tag);
    }

    return {
      searchResults: search.take(this.state.maxItems),
      totalCount: search.count(),
      tags,
github Scrivito / scrivito_example_app_js / src / Components / NotFoundErrorPage.js View on Github external
<section style="{{">
          <div>
            <div>
              <h1>Ooops</h1>
            </div>
            <div>
              <h2>
                The page you are looking for does not exist.
              </h2>
            </div>
            <div>
              
                Go to mainpage{" "}
                <i aria-hidden="true">
              </i><i aria-hidden="true">
            </i></div><i aria-hidden="true">
          </i></div><i aria-hidden="true">
        </i></section><i aria-hidden="true">
        
      
    );
  }
}</i>
github Scrivito / scrivito_example_app_js / src / prerenderContent / prerenderObjs.js View on Github external
function allObjs(objClassesBlacklist) {
  return Scrivito.Obj.all()
    .andNot("_objClass", "equals", objClassesBlacklist)
    .take();
}
github Scrivito / scrivito_example_app_js / src / Components / Tracking.js View on Github external
return Scrivito.load(() => {
    const rootPage = Scrivito.Obj.root();
    if (!rootPage) {
      return undefined;
    }
    return rootPage.get("googleAnalyticsTrackingId");
  }).then(trackingId => {
    if (trackingId) {
github Scrivito / scrivito_example_app_js / src / config / scrivitoContentBrowser.js View on Github external
import * as Scrivito from "scrivito";

Scrivito.configureContentBrowser({
  filters: {
    _objClass: {
      options: {
        All: {
          title: "All",
          icon: "folder",
          query: Scrivito.Obj.all(),
          selected: true,
        },
        Images: {
          title: "Images",
          icon: "image",
          field: "_objClass",
          value: "Image",
        },
        Pages: {
          title: "Pages",
          icon: "sheet",
          field: "_objClass",
          value: [
            "Author",
            "Blog",
            "BlogPost",
github Scrivito / scrivito_example_app_js / src / Components / Navigation / Logo.js View on Github external
function logoObj({ scrolled, navigationStyle }) {
  let logoVersion;
  if (scrolled) {
    logoVersion = "logoDark";
  } else if (navigationStyle === "transparentDark") {
    logoVersion = "logoWhite";
  } else {
    logoVersion = "logoDark";
  }

  const root = Scrivito.Obj.root();
  if (root) {
    return root.get(logoVersion);
  }

  return undefined;
}
github Scrivito / scrivito_example_app_js / src / Widgets / DividerWidget / DividerWidgetComponent.js View on Github external
Scrivito.provideComponent("DividerWidget", ({ widget }) =&gt; {
  const showLogo = widget.get("showLogo") !== "no";
  const root = Scrivito.Obj.root();

  if (showLogo &amp;&amp; root) {
    return (
      <div>
        
      </div>
    );
  }

  return <div>;
});
</div>
github Scrivito / scrivito_example_app_js / src / Components / Navigation / currentPageNavigationOptions.js View on Github external
function blogPostNavigationOptions(obj) {
  let backgroundImage = obj.get("titleImage");
  if (!backgroundImage) {
    const blog = Scrivito.Obj.getByPermalink("blog");
    if (blog) {
      backgroundImage = blog.get("navigationBackgroundImage");
    }
  }

  return imageWithMediumHeightOrMinHeight(backgroundImage);
}
github Scrivito / scrivito_example_app_js / src / utils / googleMapsApiKey.js View on Github external
function googleMapsApiKey() {
  const root = Scrivito.Obj.root();
  if (!root) {
    return "";
  }

  return root.get("googleMapsApiKey");
}

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 11 days ago

Package Health Score

68 / 100
Full package analysis