How to use the scrivito.getClass 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 / BlogPost / BlogPostNavigation.js View on Github external
const BlogPostPreviousLink = Scrivito.connect(({ currentBlogPost }) => {
  const currentDate = currentBlogPost.get("publishedAt");

  // find less than or equal publishedAt
  const [olderPost] = Scrivito.getClass("BlogPost")
    .all()
    .andNot("id", "equals", currentBlogPost.id())
    .andNot("publishedAt", "isGreaterThan", currentDate)
    .order("publishedAt", "desc")
    .take(1);

  if (!olderPost) {
    return null;
  }

  return (
    
      <i aria-hidden="true">
    </i><i aria-hidden="true">
  );
});</i>
github Scrivito / scrivito_example_app_js / src / Components / BlogPost / BlogPostNavigation.js View on Github external
const BlogPostNextLink = Scrivito.connect(({ currentBlogPost }) =&gt; {
  const currentDate = currentBlogPost.get("publishedAt");

  // find greater than publishedAt
  const [newerPost] = Scrivito.getClass("BlogPost")
    .where("publishedAt", "isGreaterThan", currentDate)
    .order("publishedAt", "asc")
    .take(1);

  if (!newerPost) {
    return null;
  }

  return (
    
      <i aria-hidden="true">
    </i><i aria-hidden="true">
  );
});
</i>
github Scrivito / scrivito_example_app_js / src / utils / textExtractRegistry.js View on Github external
export function registerTextExtract(className, attributes) {
  if (!isString(className)) {
    console.warn(
      `registerTextExtract: className '${className}' needs to be a string!`
    );
  }
  if (!Scrivito.getClass(className)) {
    console.warn(
      `registerTextExtract: className '${className}' is not defined!`
    );
  }
  if (textExtractRegistry[className]) {
    console.warn(
      `registerTextExtract: className '${className}' is already registered!`
    );
  }

  textExtractRegistry[className] = attributes;
}
github Scrivito / scrivito_example_app_js / src / Widgets / JobOverviewWidget / JobOverviewWidgetComponent.js View on Github external
Scrivito.provideComponent("JobOverviewWidget", ({ widget }) =&gt; {
  let jobsSearch = Scrivito.getClass("Job").all();
  if (widget.get("locationLocality")) {
    jobsSearch = jobsSearch.and(
      "locationLocality",
      "containsPrefix",
      widget.get("locationLocality")
    );
  }
  const jobs = [...jobsSearch];

  if (!jobs.length) {
    return (
      
        There are no job pages. Create one using the page menu.
      
    );
  }
github Scrivito / scrivito_example_app_js / src / Components / BlogPost / BlogPostPreviewList.js View on Github external
({ maxItems, author, tag, filterBlogPostId }) => {
    let blogPosts = Scrivito.getClass("BlogPost")
      .all()
      .order("publishedAt", "desc");
    if (author) {
      blogPosts = blogPosts.and("author", "refersTo", author);
    }
    if (tag) {
      blogPosts = blogPosts.and("tags", "equals", tag);
    }
    if (filterBlogPostId) {
      blogPosts = blogPosts.andNot("id", "equals", filterBlogPostId);
    }

    let posts;
    if (maxItems) {
      posts = blogPosts.take(maxItems);
    } else {

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