Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Studying the Corporate Site blog template View modes: 
User avatar
Member
Member
bdrenner-new42 - 8/14/2013 10:51:28 AM
   
Studying the Corporate Site blog template
I've inherited responsibility for an aging Kentico instance, and my employers asked me to add a blog to one of their sites. I'd like to create a blog from scratch, but all of the documentation just reuses the existing Corporate Site blog page template. So, I'm studying that blog template on a fresh installation of the Corporate Site, to learn how it is constructed. I have a few questions:

I see a document-name-filter called "Blogs filter". About the document-name-filter, the documentation says, "It is intended for use in combination with a Documents data source web part." I do not see a documents-data-source on the template, so how does the document-name-filter know what data to filter?

I see a repeater called "Blog posts repeater". In its properties, there are two transformations selected: One for list-view-mode and one for detail-view-mode. How does the repeater know which view mode it is in?

The repeater seems to require the developer to author SQL over database tables / columns. Where can the developer find the names of the columns available for selection? Similarly, how can the developer know which columns are available to a particular transformation?

Why is the same "Blog detail" template used for the blog, blog-months, and blog-posts?

Thanks,
Bryan

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 8/14/2013 2:00:23 PM
   
RE:Studying the Corporate Site blog template
If you're interested, I could hook you up with a basic blog in about 3-5 hours (depending on your specific requirements). You'd have to style it unless you have the details in which case I could do it. I'd probably spend close to an hour typing up a detailed response to all your questions if that gives you any idea of "complexity". Let me know if this of interest to you.

User avatar
Member
Member
bdrenner-new42 - 8/14/2013 3:15:59 PM
   
RE:Studying the Corporate Site blog template
Hello FroggEye,

That's very kind of you to offer. I feel like I should learn this stuff for myself, though. Indeed, there is a surprising amount of complexity involved in creating something that is relatively easy in other CMS-es. I'd love to get your detailed response to my questions, but I don't want to consume too much of your time.

I've read through nearly all of the developer documentation, so I am starting to "get it" when it comes to document types, transformations, certain common web parts, and templates.

Regarding my first question, I have come to believe that the document-name-filter is connected to its data source by having been referenced in the repeater's properties. The repeater seems to get its data from the children of the current document, which is the default when no path is specified, and it passes it on to the filter.

Regarding my third question, my guess about column names is that they come from the code-names of the fields on the document type. So, I should be able to refer to the document type's definition to discern the column names. Is this correct?

And for my fourth question, I understand that in the case of the Corporate Site's blog, the "view" varies so little between the blog's front page, month pages, and single-post pages, that making a single template promotes uniformity / consistency without duplication.

I am still curious what signals the repeater to render the list-view-mode transformation versus the detail-view-mode transformation.

Thanks,
Bryan

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/15/2013 7:36:14 AM
   
RE:Studying the Corporate Site blog template
Hi,

1. It is a filter that has basically nothing to do with blogs - it is again just a showcase of some functionality that may be used on the site. Using data sources and filters is described in this chapter. In this case, the repeater has the filter specified in its properties and they communicate together when required.

2. This is standard .Net repeater thing - the control knows according to the path which transformation should be used.

3. The SQL in the repeater is just where condition for using tags. It is described in the Tags documentation and you would read it in case you are interested in using tags. Otherwise, it is not required. There is also a DB manual available. However, it is really required when doing low level devleopment or customizations.

4. This is also one part how the repeater knows about the default and selected item transformation. The template is inherited due to the Visual inheritance. Again, you can use separate templates with different web parts and their configuration. The easiest way is to use inherited template with the same set of the web parts.

In general, you need to create a document of CMS.Blog type, fill out the form. This is the particular blog landing page. You can use the pre-defined template or your custom. To list the blogs, you need to add a repeater (the idea is the same as in listing news - it does not matter what content you are listing, it is still the same). Then, the blogger will just select to create a "Blog post" document, fill out the data and that's it.

The rest is additional - custom look and feel, styling, using e.g. tagging, categories, filters, search, etc.

Best regards,
Juraj Ondrus

User avatar
Member
Member
bdrenner-new42 - 8/15/2013 8:52:26 AM
   
RE:Studying the Corporate Site blog template
Thank you, Juraj. I'm still not clear on one thing: How does the repeater know whether to render the transformation for list-view-mode or detail-view-mode? What specifically causes it to select one or the other?

User avatar
Member
Member
bdrenner-new42 - 8/15/2013 8:59:48 AM
   
RE:Studying the Corporate Site blog template
Actually, I think I just found the answer. According to the document, Transformations 6.0, the selected-item-transformation "is used if the currently displayed document is of the same document type as is defined in the control’s class name property."

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/15/2013 9:48:29 AM
   
RE:Studying the Corporate Site blog template
Hi,

Exactly, as well as the current path. Our repeater is basically inherited from the standard ASP.Net repeater control.

Best regards,
Juraj Ondrus