Content viewer Portlet

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

Overview

A news article displayed by Content viewer Portlet
The Content viewer Portlet is a Portlet that can be used to display any type of Content. The displayed Content are shown in browse mode (using their browse Content View).

Details

The portlet gives the easiest way to display a Content in browse mode on any page. By default the Content is shown using it’s default browse Content View but this can be customized by the Contentview path property. It is a Context Bound Portlet, meaning when you are building Smart Pages the Portlet can display different Content on a single page defined by the Bind Target property (see Properties section below). So when you are building Smart Pages this portlet is the best way to display Content in browse mode because in this case the defined context Content is what appears in the portlet.

Another built-in Portlet that can be used to display Content is the Single content Portlet. This latter provides surface to edit the displayed Content right in-place, but is not Context bound, and thus it is primarily used to display static Content on pages that don't change even when used on Smart Pages. Please note, that the static behavior can also be applied to the Content viewer Portlet, using the CustomRoot bind setting.

Properties

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
Contentview path ViewPath Repository path Select a custom Contentview to use it. If left empty the Application Model will find a default view to use.
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

Context binding

Property Property name for embedding Possible values Description
Bind Target BindTarget Unselected
CurrentContent
CurrentSite
CurrentPage
CurrentUser
CurrentStartPage
CustomRoot
CurrentWorkspace
Select the bound content. Set it to CustomRoot to select a content with absolute path regardless of the context
Custom root path CustomRootPath Root relative Repository path Define bound content with absolute path when Bind Target is set to CustomRoot
Ancestor selector index AncestorIndex positive whole number Set the bound content to the ancestor of Bind Target specified by index. 0 leaves the bound content as specified above, 1 selects parent, higher value selects higher order ancestor
Relative content selector path RelativeContentPath relative Repository path Sets the bound content relative to the above settings with a relative path. Ie.: 'CustomChildFolder/CustomNode' selects 'CustomNode' from Bind Target's 'CustomChildFolder' child folder. Relative to ancestor when Ancestor selector index is set

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 Content viewer 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:ContentPortlet 
   title="Content viewer Portlet"
   ChromeType="TitleAndBorder"
   BindTarget="CustomRoot"
   CustomRootPath="/Root/Sites/Default_Site/NewsDemo/Internal/Family_Day"
   id="ContentPortlet" 
   runat="server"
/>

Example/Tutorials

You can display any kind of content by the Content viewer. If you want to see some example you can find some news dispalyed by this portlet in the default install: http://localhost/NewsDemo This link works only if you have a live demo install on your localhost! (Don't forget! Some feature needs authentication and/or admin rights!).

Related links

References