您的位置:首页 > 其它

sitecore_Sitecore简介

2020-08-21 15:02 218 查看

sitecore

Sitecore is a software technology that has been around for a number of years for building content-heavy, large-scale websites. In essence it is a software for building a custom enterprise size website builder. It has been used heavily in the enterprise world, especially by Visual Studio and ASP .NET developers, because of its connection to Microsoft. Though the Sitecore software itself is still bound to the windows environment, the company has begun developing JS compatibility tooling like JSS around their product to allow JS developers as well to develop on top of the platform.

Sitecore是一种用于构建内容繁多的大型网站的软件技术,已经存在了很多年。 本质上,它是用于构建自定义企业规模网站构建器的软件。 由于它与Microsoft的连接,在企业界已被大量使用,尤其是Visual Studio和ASP .NET开发人员。 尽管Sitecore软件本身仍与Windows环境绑定,但该公司已开始围绕其产品开发JS兼容性工具(如JSS) ,以允许JS开发人员也可以在平台之上进行开发。

The Sitecore team was one of the first teams to coin the term headless CMS architecture. The concept of a headless CMS is that you should only need to author content once, and then you should be able to use that content in a variety of places. Sitecore is a headless CMS on steroids, hijacking every request to your website and routing it through the CMS, thus allowing content editors to rearrange and reference chunks of your code within the editor. In this way, content editors can build whole pages, routes, or even entire websites themselves just using the website’s backend content editor.

Sitecore团队是最早创造无头CMS架构一词的团队之一。 无头CMS的概念是,您只需要编写一次内容,然后您就可以在各种地方使用该内容。 Sitecore是一个无类针对类固醇的CMS,劫持了对您网站的每个请求,并将其路由到CMS,从而使内容编辑器可以在编辑器中重新排列和引用代码块。 这样,内容编辑器可以仅使用网站的后端内容编辑器来构建整个页面,路线,甚至整个网站本身。

Fundamentally, Sitecore is a web server with accompanying databases that serves as the entrypoint for every new HTTP request. Every sitecore website is also accompanied by an application that is deployed in tandem that stores custom code defining the different pieces of the sitecore app. When you build on sitecore, it is essentially the scaffolding for your entire web application.

从根本上讲,Sitecore是一个带有随附数据库Web服务器 ,该数据库充当每个新HTTP请求的入口点。 每个sitecore网站还附带一个应用程序,该应用程序是一前一后部署的,该应用程序存储定义了sitecore应用程序不同部分的自定义代码。 当您在sitecore上构建时,它实质上是整个Web应用程序的支架。

基础概念 (Fundamental Concepts)

There are 10 concepts that are fundamental to Sitecore, and they can be split into 2 categories — “data” related concepts and Presentation related topics. The seminal article on this topic is the sitecore developer fundamentals document which can be downloaded as a PDF here. I, for one, read it each night before I go to bed :)

Sitecore有10个基本概念,它们可以分为2类-“数据”相关概念和Presentation相关主题。 关于该主题的开创性文章是Sitecore开发人员基础文档,可以在此处以PDF格式下载。 我每天晚上睡觉前都要看一遍:)

In the above article, Derek Roberti describes how Sitecore stores data using various databases that run alongside it, how various types of content are templated, visualized, and authored in the content editor, and finally how to use layouts and renderings to actually create new pages using the concepts of ‘rendering’ items in the content tree. I will go over each briefly below:

在以上文章中,Derek Roberti描述了Sitecore如何使用与之并行运行的各种数据库来存储数据,如何在内容编辑器中对各种类型的内容进行模板化,可视化和创作,最后介绍如何使用布局和渲染图来实际创建新页面使用内容树中“呈现”项目的概念。 我将在下面简要介绍每个内容:

  1. Databases: Sitecore stores content in seven databases: Web, Master, Security, Extranet, Recycle Bin, Archive and Core.

    数据库:Sitecore将内容存储在七个数据库中:Web,Master,Security,Extranet,回收站,存档和Core。
  2. Items: The representation of these data items to the user is a content tree within the SC database (see the content tree picture below). The content items are separated by their function, as a content item can be used for many different purposes. The items within the root folder ‘/home’ are typically used for routing and so sitecore will look there when a user visits yourwebsite.com/. They will contain references to other items that will define the way the page should render. The items in the ‘/content’ folder are typically used only to store content, and not to define presentation, and those in the ‘/layout’ folder are used to define specific peices of presentational logic.

    项目:这些数据项目对用户的表示是SC数据库中的内容树(请参见下面的内容树图片)。 内容项按其功能分开,因为内容项可用于许多不同目的。 根文件夹“ / home”中的项目通常用于路由,因此,当用户访问yourwebsite.com/时,sitecore会在其中查找。 它们将包含对其他项的引用,这些其他项将定义页面应呈现的方式。 “ / content”文件夹中的项目通常仅用于存储内容,而不用于定义表示,而“ / layout”文件夹中的项目则用于定义表示逻辑的特定部分。
  3. Templates: A type of content item. Here you can define the fields that will be defined on any item of this type that is created. For example if you set up a template for an “automobile” item, every time you create a new automobile it will contain these feilds. Because a lot of the power of sitecore is in editability by non-technical users, there is a lot of customizeability in the templates that are used to generate items.

    模板:一种内容项。 在这里,您可以定义将在创建的这种类型的任何项目上定义的字段。 例如,如果您为“汽车”项目设置模板,则每次创建新汽车时,它将包含这些字段。 由于sitecore的强大功能在于非技术用户的可编辑性,因此用于生成项目的模板具有很多可定制性。
  4. Masters: An extension of the templating concept, a master is essentially any additional logic that we want to define around the creation of a new instance of an item. Here we can define things like which fields will have default values in them, if the item that we created can accept children of any type or only select types, etc.

    母版:母版是模板概念的扩展,从本质上讲,母版是我们要围绕创建新的项目实例定义的任何其他逻辑。 如果我们创建的项目可以接受任何类型的子代或仅选择类型,则在这里我们可以定义诸如哪些字段将具有默认值之类的内容。
  5. Device: This is the concept in sitecore of the requesting agent (mobile, desktop, ipad, etc.)

    设备:这是请求代理(移动设备,台式机,ipad等)的sitecore中的概念
  6. Layouts: This is the highest level presentational component. It defines certain types of commonly used presentational logic for a page, and will reference a chunk of html/cshtml that will be used to render it. it will have placehoders for dynamic content. the typical example of this type of item is a header/foooter layout.

    布局:这是最高级别的演示组件。 它定义了页面的某些常用表示逻辑类型,并将引用将用于呈现页面的html / cshtml块。 它将具有动态内容的占位符。 此类项目的典型示例是页眉/页眉布局。
  7. Sublayouts: This is another level down in terms of the preseentation of your content. You might for example want to define a 2-column layout sublayout item that you can combine with your header/footer primary layout to get the desired effect.

    子版式:与内容的呈现方式相比,这是另外一个层次。 例如,您可能想定义一个2列布局子布局项目,可以将其与页眉/页脚主布局结合使用以获得所需的效果。
  8. Renderings: This is the primary presentational item and there will be many of these in a typical project. These definne a chunk of html/cshtml code that will be hydrated with data and present the content to the user. An example of this could be a product list or an image carousel.

    渲染:这是主要的演示项目,在一个典型的项目中将有很多。 这些定义了一大堆html / cshtml代码,这些代码将与数据混合并向用户呈现内容。 例如产品列表或图像轮播。
  9. Static and Dynamic Placement: There are two ways to define the way that rendering happens, the first is to actually add the html/cshtml content to your rendering and the second is to add a placeholder to your rendering that will resolve to a content item at runtime. The former is called static placement and the latter is called dynamic placement.

    静态和动态放置:有两种定义渲染发生方式的方法,第一种是将html / cshtml内容实际添加到渲染中,第二种是在渲染中添加占位符,该占位符将解析为内容项运行。 前者称为静态放置,后者称为动态放置。

使用Sitecore进行路由 (Routing With Sitecore)

Sitecore differs from a classic CMS in that it actually controls the routing of your application. What that means is when requests come in for your website, sitecore can actually read the content of your backend data store, build the page according to the structure of the data that it has stored, and then return that complete page to the user.

Sitecore与经典CMS的不同之处在于,它实际上控制了应用程序的路由。 这意味着,当您的网站收到请求时,sitecore实际上可以读取您的后端数据存储的内容,根据其存储的数据结构构建页面,然后将该完整的页面返回给用户。

The most important thing that this allows content editors to do is define routes entirely in the content editor, and add the pages and content that corresponds to those new routes. When a user requests my.website.com/home/products, the Sitecore application will look in the content tree before looking at anything else, if there is a content item at the given route in the content tree, Sitecore will find rendering details for that item and create it as a fully functioning page.

内容编辑器要做的最重要的事情是完全在内容编辑器中定义路由,并添加与那些新路由相对应的页面和内容。 当用户请求my.website.com/home/products时,Sitecore应用程序将先查看内容树,然后再查看其他内容,如果内容树中给定路线上有内容项,Sitecore将查找以下内容的渲染详细信息:该项目并将其创建为功能齐全的页面。

When a request comes in to a url, sitecore will take the following steps:

当请求进入网址时,sitecore将采取以下步骤:

  1. Sitecore analyzes the request to determine which device is making the request.

    Sitecore分析请求以确定哪个设备正在发出请求。
  2. Sitecore determines which content item is being requested based on the path in the URL.

    Sitecore根据URL中的路径确定要请求的内容项。
  3. Sitecore looks at the item’s presentation settings. If there are no presentation settings at the item level, Sitecore looks at the item’s template standard values.

    Sitecore会查看该项目的演示设置。 如果项目级别没有演示设置,则Sitecore会查看项目的模板标准值。
  4. Based on the presentation settings, Sitecore uses the appropriate layout and adds all statically-placed sublayouts and renderings.

    根据演示文稿设置,Sitecore使用适当的布局,并添加所有静态放置的子布局和渲染。
  5. Sitecore then adds all of the dynamically placed sublayouts and renderings and returns an HTTP response

    然后,Sitecore会添加所有动态放置的子布局和渲染,并返回HTTP响应

To make this clearer, take a look at the diagram below:

为了使这一点更清楚,请看下面的图:

The end result of all this work is that Sitecore creates a backend platform that allows content editors to do a lot of things wihtout you.

所有这些工作的最终结果是,Sitecore创建了一个后端平台,该平台使内容编辑器可以完成很多工作。

They can reference chunks of your code (renderings) within content items. If you do your job as a Sitecore developer, you can build in such a way that a non-technical content editor can actually add new website pages, routes, or even entire websites themselves using the website’s backend.

他们可以在内容项中引用您的代码块(渲染)。 如果您以Sitecore开发人员的身份工作,则可以采用非技术内容编辑器可以使用网站后端实际添加新网站页面,路线甚至整个网站本身的方式进行构建。

Thanks for reading.

谢谢阅读。

~ Alex Zito-Wolf

亚历克斯·齐托·沃尔夫

翻译自: https://medium.com/swlh/sitecore-introduction-14ff83194f28

sitecore

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: