Re-usable global content

Tom Troughton asked on February 27, 2015 10:36

I'm relatively new to Kentico (far more experience with Sitecore) and currently I'm trying to understand best practice around creating re-usable global content in Kentico.

This would be the kind of content that is not a page itself, but which I want to use on multiple pages. For example, I might want to give an editor the facility to create an image slideshow that can be added to multiple pages via a web part. This slideshow would be a collection of slide definitions (media gallery image plus other fields e.g. tile, summary).

In Sitecore this is simply a case of defining the necessary templates (which equate to page/document types in Kentico) then creating the required content outside the root of the site. This content will only then be surfaced when pulled into a component on a page.

From what I gather, the closest Kentico offers is custom tables, but from my initial investigation this is inflexible. For example, it doesn't allow a tree structure for this content. I'd view this as content just like pages and would want security to be applied in a similar manner. In the above example, I might want News authors to only be able to create and use image slideshows that relate to new stories so I'd expect to isolate these under a New Slideshows folder. Also, custom tables are flat representations of data. In my above example, I'd want to define a slideshow as a container for numerous slide records.

I hope I'm being clear here. Should I be looking at creating a custom module i.e. in this example an Image Slideshows modules? Or is there native functionality which offers what I'm looking for? Right now I'm confused that Kentico seems to define 'content' as pages. I tend to think of 'content' in a more modular way, and 'pages' more as containers for re-usable content.

Your advice would be appreciated.

Correct Answer

Brenden Kehren answered on February 27, 2015 19:52

Pages = content. Multiple pages can make up a single page and you'd never navigate or see the "pages" that make up the main page. How you display the pages/content is where it differs.

Kentico is driven by page types so you will find "content" or page type filters in almost anything displaying data. Within the Google Sitemap XML webpart, there is a Content section, this is where you filter out what shows in your sitemap. Same is true for the search results. When you create your smart search index, you define what page types you want to index and search for.

There are many approaches to using "global" content. One thing I like are linked documents. This allows you to create a page/document/content in a single location and create a link to that main document while placing it within another node in the content tree.

For instance what I've done in the past is created a custom page type called Call To Action (CTA). This has a few fields, Name, Title, Content (simplified). I then create a folder at the root of the content tree: /global content. In there create a new CTA and fill out the fields. Then say your page template for the home page has a repeater on it that is set to display all the CTA's below the /Home page. What you can do under the /Home node is create a new page and in the list, select the very bottom option to Link an existing document and select one from the /global content directory. Your home page will now display that document.

The great piece behind "linked documents" is that no matter where within the content tree these documents are, if you edit it in one place, it updates all instances of it, therefore creating your "global" content.

Hope this example clarifies a few things.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Petar Kozjak answered on February 27, 2015 11:08 (last edited on February 27, 2015 11:10)

Hi,

I'm not sure did I understand correctly. So if you want to create Banner or Image slider that will be populated in one location and displayed on multiple what you need to do is following:

  1. Create a page type (aka document type) Slider that will have name, image (media library selector or direct file upload)
  2. Place this slider page type under some page or under some folder
  3. Create a repeater that displays this slider. What I like to use is normal repeater where you can edit transformation
  4. Now when you have this repeater configured you can copy it to any other page. Only thing you need to always check is it reading correct path to where slider page type is stored.

Also big question is do you use ASPX or PortalEngine. I would recommend to use PortalEngine or investigate how it works: https://docs.kentico.com/display/K8/Developing+websites+using+the+Portal+engine

1 votesVote for this answer Mark as a Correct answer

Tom Troughton answered on February 27, 2015 11:57

Thanks for the response Petar. My problem with this approach is that I'd be creating an addressable page. I'd be relying on authors to remember to hide from sitemap, navigation etc. It would only make sense if I wanted a area of my site where a visitor (in this example) could access all my image slideshows.

That's not the point, I want to create some content that is re-usable in pages but is not a page itself. When defining a website's content this distinction between pages and re-usable content is critical. Are you suggesting it's not possible in Kentico?

Out of interest, how is the ASPX/PortalEngine decision relevant to this?

0 votesVote for this answer Mark as a Correct answer

Petar Kozjak answered on February 27, 2015 12:13

Hi,

let me put is like this if you store your content if Page Types like Article, News, Media Library you can easily call them to any location. Even to make it easier for editors to call this content you can create Widgets with predefined setting so they only need to select from what source (or path) to call that content.

Portal Engine can help you to develop this things much faster. Simple site with HTML files in Portal Engine can be built in few hours. Changes can be made really quick.

If you want I can show you how we approach this. Find me on LinkedIn and I'll share our experience and some advices.

0 votesVote for this answer Mark as a Correct answer

Tom Troughton answered on February 27, 2015 12:36

OK, thanks, I understand all that, but I don't feel it addresses my original question. Also, I don't work with "simple sites", I work with large, global enterprise web platforms.

So you're saying to create re-usable content in Kentico I must create a page defined by a Page Type and manifested as a publicly available web page addressable by URL. What if my content is not intended to be a web page? In Sitecore projects this is very common, so I'm surprised Kentico doesn't offer anything similar.

In sophisticated CMS development there is always a requirement to define re-usable component content entirely distinct from pages. I refer you back to my original point: "I tend to think of 'content' in a more modular way, and 'pages' more as containers for re-usable content". Kentico neatly provides web parts and widgets to allow a component-driven approach, so I'm surprised it insists upon the source of components always being other pages.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on February 27, 2015 14:16

Petar's approach works very well and works well in an "enterprise" environment. You are correct in saying content is modular and pages are containers re-usable, which is the approach Petar is suggesting. Yes Page Types will have "page like" metadata and URLs associated with them but very rarely are they ever shown in sitemaps, search results (local or external like Google) or do people navigate to them. The reason being is because you can define your sitemaps and search results to not index or show any of those page types.

You can easily create a modular content website using custom page types without any issue and it will work for a site with as few as 5 viewable pages or 10,000 viewable pages.

Comparing SiteCore to Kentico is like comparing apples to oranges, yes they are both CMS solutions but they are two completely different pieces of software. I'd suggest checking out the documentation section of the DevNet and taking a look at the Quick Start guide.

3 votesVote for this answer Mark as a Correct answer

Reza Zareian Fard answered on February 27, 2015 14:55 (last edited on February 27, 2015 15:06)

Tom Troughton, As a both Kentico and Sitecore certified developer, first of all the architecture of these two are completely different although they have lots of features in common. So try to avoid copying same approach you have in Sitecore into Kentico.

Kentico has a concept for these kind of contents which doesn't need to be displayed by Url and are data items only, which its name is Custom Tables.

They will not be included into content tree but you can still load them using Listing and View web parts or load them into fields like dropdown llists or etc.

For example in your case you can define a Custom Table with the fields required like image, title, description, action button text, action button link, etc.

After that you can add records to this custom table and load those records into a repeater.

For more information please refer to the link below:

Custom Tables

0 votesVote for this answer Mark as a Correct answer

Tom Troughton answered on February 27, 2015 18:06

Brenden and Reza - thank you both for your comments.

I appreciate that Sitecore and Kentico differ fundamentally. I'm not looking for how Kentico can replicate Sitecore, I'm looking at how Kentico can meet what I see as a fairly typical CMS requirement. I just used my experience of Sitecore as an example.

Reza, I've looked a lot at custom tables but don't see this concept as flexible enough in terms of authoring security and managing as a tree of content. See my original post. As far as I can tell it's not even possible to assign workflows to custom table data, but I might be wrong.

Brenden, I have of course spent a lot of time in the documentation and exploring the samples. Based on your advice it would seem using page types is my only option. Do you happen to know where I might find examples of setting "sitemaps and search results to not index or show any of those page types"?

I still find it odd that authors are expected to create 'pages' when they're not actually creating web pages. I wonder if the name 'document type' was more appropriate?

0 votesVote for this answer Mark as a Correct answer

Reza Zareian Fard answered on March 1, 2015 06:29

Tom Troughto, Yep Sorry, I didn't notice that you already mentioned the Custom Tables limitations.

As Brenden already mentioned, Page Types are equal to content. Just look at them like Item Templates.

In addition to Brenden's solution, Another option to specify limitation for content creation (Like Insert Options) is Scopes which are working for the same purpose, so you can define a container page type for the slide shows then specify which type can only be created underneath.

Then you will need to configure your selectors, controls or web parts to only point to that specific path. (Similar to source of fields).

0 votesVote for this answer Mark as a Correct answer

Tom Troughton answered on March 2, 2015 14:38

Thank you all. Marked Brenden's answer as Correct because it was most complete, and closest to what I wanted, but I appreciate everyone's advice.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.