Single content Portlet

From Sense/Net Wiki
Jump to: navigation, search
  •  
  •  
  •  
  •  
  • 100%
  • 6.0
  • Enterprise
  • Community
  • Planned

Overview

A WebContentDemo displayed in a Singe content Portlet
The Single content Portlet provides an easy way to display any type of Content using different Content Views. It also provides easy-to-access surfaces for in-place editing of the displayed Content and to create new Content.

Details

The Portlet provides an easy way to display a Content with a custom Content View on any stand-alone page. By default the Content is shown with it’s default Content View but this can be customized by the Browse contentview path option. It is important to know that this portlet is not a Context Bound Portlet and thus it cannot take advantage of the Smart Application Model when building Smart Pages. Only static Content can be displayed with the Single content Portlet that are either placed on stand-alone pages or independent of the current Content being presented on a Smart Page. To display Content using Smart Pages use the Content viewer Portlet, which is a context bound Portlet with similar functionality.

The Single Content Portlet not only can display a Content with a customized view but it also provides surface to instantly edit the current Content that is displayed in the Portlet. You can also create a new Content of specified Content Type in-place to be displayed by the Portlet. These actions can be accessed by clicking the action arrow at the top right corner of the Portlet visible when the page is in edit mode. The appearing dropdown menu shows different actions depending on the mode of the current Content being displayed in:

If the Content displayed is in browse mode you see the Edit content, New content, Delete and Edit actions as the image shows:

Actions in browse mode

If the Content is in edit mode or when you are creating a new content you see the Browse, New content, Delete and Edit actions as the image shows:

Actions in edit mode


Portlet Actions

  • Edit content: When clicking this link the displayed Content will be switched to edit mode, and it will be presented with its edit Content View (the edit Content View can be set with the Edit contentview path property). This mode can be used to edit the displayed Content right-away in the Portlet, without the need to navigate to the Content in Explore and edit it.
  • New content: Using this action you can create new Content to be displayed in the Portlet. The edit Content View will be displayed to allow Fields of the Content to be set. The Content Type of the created Content is defined by the Content type name property. The allowed Content Types are defined in the Web.config with the WebContentNameList key. By default it is WebContent meaning that child Content Types of WebContent Content Type will appear in the dropdown (this includes three types by default: Article, HTMLContent, WebContentDemo). The Content will be created under the current page's parent in the Content Repository. For example if you are on a page named TestPage and you put a Single content Portlet on it and you create an article with this portlet, the article will be created under the TestPage in the repository.
  • Browse content: This action will show the default or the customized browse view of the Content - you can specify custom Content View with the Browse contentview path property.
  • Edit: This is the default edit action of the portlet for editing portlet properties. For more information see editing portlet properties.

Supported Content Types

By default, there are three Content Types you can select for the Content type name property. These are Article, HTMLContent and WebContentDemo. Below you can see examples screenshots for each of these types showing browse and edit views:

Article
Article in browse view
Article in edit view
HTMLContent
HTMLContent in browse view
HTMLContent in edit view
WebContentDemo
WebContentDemo in browse view
WebContentDemo in edit view

Properties

Own properties

Webcontent

Property Property name for embedding Possible values Description
Content type name UsedContentTypeName Article
HTMLContent
WebContentDemo
The default content type used in 'New content' and 'Edit content' scenarios
Content path ContentPath Root relative Repository path Path of the content to be presented
Browse contentview path ContentViewPath Root relative Repository path Path of presented content's browse contentview. Leave empty to use default contentview resolution logic
Edit contentview path ContentViewEditPath Root relative Repository path Path of presented content's edit contentview. Leave empty to use default contentview resolution logic
Use url params to resolve content UseUrlPath true/false If set to true content path can be given with 'Content' url query parameter
ContentPath url query key name UrlQueryKey text The url query key name that will be used when Content is resolved using url params
Content validity check ValidationSetting DontCheckValidity
ShowAllValid
ShowValidButArchived
ShowValidButNotArchived
Validation check uses content's 'ValidFrom' and 'ValidTill' properties. Archive check uses 'ArchiveDate' property

Inherited properties

User interface

Property Property name for embedding Possible values Description
Portlet title Title text Sets the visible title of the current portlet. Title header visibility is controlled with Appearance property
Appearance ChromeType Default
None
TitleAndBorder
TitleOnly
BorderOnly
Controls title and border visibility. By default both are visible
Custom CSS class(es) SkinPreFix text When set portlet container div gets an extra css class. Ie. 'skinexample' adds css class 'skinexampleSkin' to container div

Cache

Property Property name for embedding Possible values Description
Portlet is cached Cacheable true/false If set the output of the portlet will be cached
Portlet is cached for logged in user CacheableForLoggedInUser true/false If set the output of the portlet will be cached even if the user is logged in.
Request path influences caching CacheByPath true/false Defines whether the requested content path is included in the cache key. When unchecked portlet output is preserved regardless of the page's current context content or request path. Check it if you want to cache portlet output depending on the requested context content.
Url query params influence caching CacheByParams true/false Defines whether the url query params are also included in the cache key. When unchecked portlet output is preserved regardless of changing url params
Language influences caching CacheByLanguage true/false Defines whether the language code is also included in the cache key. When unchecked portlet output is preserved regardless of the language that the users use to browse the site. If set, a different output will be cached for any language the users visit the site on.
Sliding expiration SlidingExpirationMinutes positive whole number Given in minutes. The portlet is refreshed when it has not been accessed for the given minutes
Absolute expiration AbsoluteExpiration positive whole number Given in seconds. The portlet will be refreshed periodically with the given time period
Debug Debug true/false Check this property to show debug info about portlet cache state at the bottom of the portlet's layout

for Portal builders

PageTemplate embedding code

If you want to embed your Single content Portlet into your pagetemplates somewhere, look at the following markup. The attributes/options and the range of their accepted values are the same as above.(Don't forget to include a unique ID and runat="server" attributes!)

<snpe:SingleContentPortlet
   ContentPath="/Root/Sites/Default_Site/NewsDemo/External/Workshop"
   UsedContentTypeName="Article"
   ChromeType="None"
   Title="Single content Portlet" 
   ID="Single content Portlet" 
   runat="server"
   id="SingleContentPortlet1"
/>

Example/Tutorials

Related links

References