Generic List Widget - Akumina Community

Generic List Widget

Estimated reading time: 12 min

The GenericList widget is a flexible widget which can work with any content type (SharePoint list structure) to retrieve data for an array of list items that is then passed to a View to render on the site.

Main Features

  • The GenericList widget returns an array of content item from the specified list
  • The column data returned for those items can be specified on an instance basis
  • The GenericList widget can work with any list and is not dependent on a specific content type
  • As a flexible content data retrieval widget, many views can be associated with the widget to provide flexible rendering of the data elements on the site.

The following sections are examples of the widget instances found in the OOTB Digital Workplace which use the GenericList Widget.

GenericList – NewsDetail

Main Features

  • Provides a summary list of the items in the news list
  • Displays and Orders the items based on their Start Date
  • Does not display items that have reached their Expiration Date
  • Includes a link to the full news listing page

Uses List Definition(s): (click to view definition)

CompanyNews_AK

DeptNews_AK

GenericList – News Detail Widget Properties Example Instance

 

Property Details
List is on root site If false, the list which contains the data for this instance is on the current site.

If true, the list which contains the data is on the root of the Site Collection.

selectfields The data fields (columns) from the SharePoint list that the widget should retrieve for use in this instance.

For this example, the selectfields = Created,Image,FriendlyUrl,Start_x0020_Date,AnnouncementTitle

enable paging If false, the widget will not display paging controls

If true, the widget will display paging controls (if implemented by developer in widget)

items/page Sets the number of items to display on each page IF paging is enabled.
list name Name of the SharePoint list that contains the data to be displayed for this instance.
callbackmethod The callbackmethod is set by the developer of the widget.  For this use, the method to specify is “ShowNewsItems”
isasynccallback Value for this type of instance = false
viewxml The viewxml contains any special manipulation of the data that needs to be done by the widget BEFORE it gets render by the specified view.  In this case, the viewxml is set to the following string:

<View><Query><OrderBy><FieldRef Name=’Start_x0020_Date’ Ascending=’FALSE’></FieldRef></OrderBy><Where><And><Leq><FieldRef Name=’Start_x0020_Date’></FieldRef><Value IncludeTimeValue=’TRUE’ Type=’DateTime’><Today ></Today></Value></Leq><Or><Geq><FieldRef Name=’Expires’ ></FieldRef><Value IncludeTimeValue=’TRUE’ Type=’DateTime’><Today ></Today></Value></Geq><IsNull><FieldRef Name=’Expires’ ></FieldRef></IsNull></Or></And></Where></Query><RowLimit>4</RowLimit></View>

 

Note that the number of items (Rows) to display on the site is specified in the <RowLimit>4</RowLimit> argument.

callbacktype Value for this type of instance = postdataload
dataloadproperties N/A
cache interval Sets the time (in secs) that the data should be saved in the local browser cache of the current user.

0 = do not cache the data for this widget

-1 = use the default caching strategy set in the Digital Workplace configuration

[whole number] = cache for specified time (secs)

VIEW View Name = NewsDetail-SideContent

View Template URL =

/Style Library/digitalworkplace/Content/Templates/GenericList/NewsList.html

 

GenericList – Hero Item

 

Main Features

  • Displays a single news item from a list as a hyperlinked image with a display title overlay
  • Selection of the new item to display is determined by tags in the widget instance
  • Can be set to display the latest content with a specific tag
  • Can be targeted based on the current user’s department, city or AD group
  • Item is hyperlinked using the FriendlyURL to the dynamic display page for the content

Uses List Definition(s): (click to view definition)

CompanyNews_AK

GenericList – Hero Item Widget Properties Example Instance

 

Property Details
List is on root site If false, the list which contains the data for this instance is on the current site.

If true, the list which contains the data is on the root of the Site Collection.

selectfields The data fields (columns) from the SharePoint list that the widget should retrieve for use in this instance.

For this example, the selectfields = AnnouncementTitle,Image,Category,FriendlyUrl

enable paging If false, the widget will not display paging controls

If true, the widget will display paging controls (if implemented by developer in widget)

items/page Sets the number of items to display on each page IF paging is enabled.
list name Name of the SharePoint list that contains the data to be displayed for this instance.
callbackmethod The callbackmethod is set by the developer of the widget.  For this use, the method to specify is “ShowHeroItem”
isasynccallback Value for this type of instance = false
viewxml N/A for this type of instance
callbacktype Value for this type of instance = customdataload
dataloadproperties {“tag”:”CORPORATE”,”featured”:”true”,”callback”:”GetTagAsValue”}

 

For this widget, you can specify several “name”:”value” properties to control the functionality:

tag – this value is used when you want to display content based on a specific metadata tag that has been applied.  In the example above, the widget is looking for content that has been tagged with the term CORPORATE.

featured – this is another flag which can be used to further refine the content criteria to only select from content that has the “featured” flag set (an option in the App Manager content app).  Values are true or false.

callback – this determines the type of logic which will be used to determine the content to display.  The following are the values that can be used:

  • GetTagAsValue – will select from content that has the metadata tag defined in the tag property.
  • GetTagAsDepartment – will select from content that has the metadata tag that matches the Department value from their AzureAD user data.  For example, if the current user is in the Finance department as defined in Azure AD, using this callback value would display content tagged with “Finance”.  This is used for targeting content to the current user.
  • GetTagAsCity – will select from content that has the metadata tag that matches the City value from their AzureAD user data.  For example, if the current user is in Boston as defined in Azure AD, using this callback value would display content tagged with “Boston”.  This is used for targeting content to the current user.
cache interval Sets the time (in secs) that the data should be saved in the local browser cache of the current user.

0 = do not cache the data for this widget

-1 = use the default caching strategy set in the Digital Workplace configuration

[whole number] = cache for specified time (secs)

VIEW View Name = HomePage-Hero

View Template URL =

/Style Library/digitalworkplace/Content/Templates/GenericList/TargetedNewsItem.html

 

GenericList – Department Listing Page

 

Main Features

  • Automatically displays the list of enabled subsites (Departments) with hyperlinked icons and titles
  • Uses the settings in the Department Manager management app to determine the color and the visibility of the department link.

GenericList – Department Listing Widget Properties Example Instance

 

Property Details
List is on root site If false, the list which contains the data for this instance is on the current site.

If true, the list which contains the data is on the root of the Site Collection.

selectfields N/A for this use.

 

enable paging If false, the widget will not display paging controls

If true, the widget will display paging controls (if implemented by developer in widget)

items/page Sets the number of items to display on each page IF paging is enabled.
list name N/A for this use.
callbackmethod The callbackmethod is set by the developer of the widget.  For this use, the method to specify is “ShowDepartmentItems”
isasynccallback Value for this type of instance = false
viewxml N/A for this use.
callbacktype Value for this type of instance = customdataload
dataloadproperties N/A for this use.
cache interval Sets the time (in secs) that the data should be saved in the local browser cache of the current user.

0 = do not cache the data for this widget

-1 = use the default caching strategy set in the Digital Workplace configuration

[whole number] = cache for specified time (secs)

VIEW View Name = DepartmentList

View Template URL =

/Style Library/digitalworkplace/Content/Templates/GenericList/DepartmentList.html

 

GenericList – Dashboard My Apps

 

Main Features

  • Provides quick access to AppManager apps directly from the front end site
  • Once logged into AppManager, displays a select list of sites that the current user can access, along with the associated apps the user can access for each site.
  • Clicking on an app icon launches the app in a new tab or window

GenericList – My Apps Widget Properties Example Instance

 

Property Details
List is on root site If false, the list which contains the data for this instance is on the current site.

If true, the list which contains the data is on the root of the Site Collection.

selectfields N/A for this use.
enable paging If false, the widget will not display paging controls

If true, the widget will display paging controls (if implemented by developer in widget)

items/page Sets the number of items to display on each page IF paging is enabled.
list name N/A for this use.
callbackMethod The callbackmethod is set by the developer of the widget.  For this use, the method to specify is “DashboardShowAppsItems”
isasynccallback Value for this type of instance = false
viewxml N/A for this use.
callbacktype Value for this type of instance = customdataload
dataloadproperties N/A for this use.
cache interval Sets the time (in secs) that the data should be saved in the local browser cache of the current user.

0 = do not cache the data for this widget

-1 = use the default caching strategy set in the Digital Workplace configuration

[whole number] = cache for specified time (secs)

VIEW View Name = Dashboard-My-Apps

View Template URL =

/Style Library/DigitalWorkPlace/Content/Templates/Dashboard/AppsList.html

 

GenericList – Home Page Department News

 

Main Features

  • Displays news items from specified departments (subsites)
  • If UserContext is enabled, displays the news item from the current user’s department in the lead (top) position.
  • If more departments than slots available, does a random display of 4 sites (configurable)
  • Each item is linked to the FriendlyURL

Uses List Definition(s): (click to view definition)

DeptNews_AK

GenericList – Home Page Department News Widget Properties Example Instance

 

Property Details
List is on root site If false, the list which contains the data for this instance is on the current site.

If true, the list which contains the data is on the root of the Site Collection.

selectfields The data fields (columns) from the SharePoint list that the widget should retrieve for use in this instance.

For this example, the selectfields = Title,Image,FriendlyUrl

enable paging If false, the widget will not display paging controls

If true, the widget will display paging controls (if implemented by developer in widget)

items/page Sets the number of items to display on each page IF paging is enabled.
list name Name of the SharePoint list that contains the data to be displayed for this instance.
callbackmethod The callbackmethod is set by the developer of the widget.  For this use, the method to specify is “ShowHomePageDepartmentNewsItems”
isasynccallback Value for this type of instance = false
viewxml The viewxml contains any special manipulation of the data that needs to be done by the widget BEFORE it gets render by the specified view.  In this case, the viewxml is set to the following string:

<View><Query><OrderBy><FieldRef Name=’Start_x0020_Date’ Ascending=’FALSE’></FieldRef></OrderBy><Where><And><Leq><FieldRef Name=’Start_x0020_Date’ ></FieldRef><Value IncludeTimeValue=’TRUE’ Type=’DateTime’><Today ></Today></Value></Leq><Or><Geq><FieldRef Name=’Expires’ ></FieldRef><Value IncludeTimeValue=’TRUE’ Type=’DateTime’><Today ></Today></Value></Geq><IsNull><FieldRef Name=’Expires’ ></FieldRef></IsNull></Or></And></Where></Query><RowLimit>1</RowLimit></View>

 

Note that the number of items (Rows) to display on the site is specified in the <RowLimit>1</RowLimit> argument.

callbacktype Value for this type of instance = customdataload
dataloadproperties For this widget, you can specify the list of departments/sub-sites from which you want to display news items.  If you specify more than four departments, the widget will pull from four departments randomly.

To specify departments, add in the ‘URL’ value (not name) for the department using the following format

=”{‘sites’:[‘Marketing’,’HR’,’IT’,’Finance’]}”

NOTE: If targeting is enabled, the lead article will be displayed from the current users Department as defined in their User profile.  If their department is not in the list of available departments, then the widget will default to displaying random departments.

cache interval Sets the time (in secs) that the data should be saved in the local browser cache of the current user.

0 = do not cache the data for this widget

-1 = use the default caching strategy set in the Digital Workplace configuration

[whole number] = cache for specified time (secs)

VIEW View Name = Home-DeptNews

View Template URL =

/Style Library/DigitalWorkPlace/Content/Templates/GenericList/HomeDepartmentNews.html

 

GenericList – Home Page Photos list

 

Main Features

  • Provides a summary listing of the most recent additions to the Photo Gallery, with a link to the Media Galley page
  • Click on an image will launch a modal window viewer for that image

Uses List Definition(s): (click to view definition)

ImageGallery_AK

GenericList – Home Page Photos List Widget Properties Example Instance

 

Property Details
List is on root site If false, the list which contains the data for this instance is on the current site.

If true, the list which contains the data is on the root of the Site Collection.

selectfields The data fields (columns) from the SharePoint list that the widget should retrieve for use in this instance.

For this example, the selectfields = _ModerationStatus,Image

enable paging If false, the widget will not display paging controls

If true, the widget will display paging controls (if implemented by developer in widget)

items/page Sets the number of items to display on each page IF paging is enabled.
list name Name of the SharePoint list that contains the data to be displayed for this instance.
callbackmethod The callbackmethod is set by the developer of the widget.  For this use, the method to specify is “ShowFeaturedPhotoItems”
isasynccallback Value for this type of instance = false
viewxml The viewxml contains any special manipulation of the data that needs to be done by the widget BEFORE it gets render by the specified view.  In this case, the viewxml is set to the following string:

<View><Query><OrderBy><FieldRef Name=’Created’ Ascending=’FALSE’></FieldRef></OrderBy></Query><RowLimit>5</RowLimit></View>

Note that the number of items (Rows) to display on the site is specified in the <RowLimit>5</RowLimit> argument.

callbacktype Value for this type of instance = postdataload
dataloadproperties N/A for this use.
cache interval Sets the time (in secs) that the data should be saved in the local browser cache of the current user.

0 = do not cache the data for this widget

-1 = use the default caching strategy set in the Digital Workplace configuration

[whole number] = cache for specified time (secs)

VIEW View Name = HomePage-Photos

View Template URL =

/Style Library/digitalworkplace/Content/Templates/GenericList/FeaturedPhotos.html

 

GenericList – Photos Media Gallery Page

 

Main Features

  • Provides a listing of images which have been enabled for display in the Gallery using the Image Gallery App
  • Clicking on an image will launch a modal window viewer for that image
  • Supports lazy load of images as the user scrolls the browser window to optimize performance

Uses List Definition(s): (click to view definition)

ImageGallery_AK

GenericList – Photos Media Gallery Widget Properties Example Instance

 

Property Details
List is on root site If false, the list which contains the data for this instance is on the current site.

If true, the list which contains the data is on the root of the Site Collection.

selectfields The data fields (columns) from the SharePoint list that the widget should retrieve for use in this instance.

For this example, the selectfields = Image

enable paging If false, the widget will not display paging controls

If true, the widget will display paging controls (if implemented by developer in widget)

items/page Sets the number of items to display on each page IF paging is enabled.
list name Name of the SharePoint list that contains the data to be displayed for this instance.
callbackmethod The callbackmethod is set by the developer of the widget.  For this use, the method to specify is “ShowMediaGalleryPhotoItems”
isasynccallback Value for this type of instance = false
viewxml N/A for this use
callbacktype Value for this type of instance = postdataload
dataloadproperties N/A for this use
cache interval Sets the time (in secs) that the data should be saved in the local browser cache of the current user.

0 = do not cache the data for this widget

-1 = use the default caching strategy set in the Digital Workplace configuration

[whole number] = cache for specified time (secs)

VIEW View Name = MediaGallery-Photos

View Template URL =

/Style Library/digitalworkplace/Content/Templates/GenericList/MediaGalleryPhotoList.html

 

GenericList – FAQ Summary

 

Main Features

  • Summary list of the Question/Answer pairs for the FAQ’s
  • Maximum number of items to be displayed can be set
  • Displays link to the full FAQ listing page

Uses List Definition(s): (click to view definition)

FAQ_AK

GenericList – FAQ Summary Widget Properties Example Instance

 

Property Details
List is on root site If false, the list which contains the data for this instance is on the current site.

If true, the list which contains the data is on the root of the Site Collection.

selectfields The data fields (columns) from the SharePoint list that the widget should retrieve for use in this instance.

For this example, the selectfields = Title,Answer,ItemActive

enable paging If false, the widget will not display paging controls

If true, the widget will display paging controls (if implemented by developer in widget)

items/page Sets the number of items to display on each page IF paging is enabled.
list name Name of the SharePoint list that contains the data to be displayed for this instance.
callbackmethod The callbackmethod is set by the developer of the widget.  For this use, the method to specify is “ShowFAQItems”
isasynccallback Value for this type of instance = false
viewxml The viewxml contains any special manipulation of the data that needs to be done by the widget BEFORE it gets render by the specified view.  In this case, the viewxml is set to the following string:

<View><Query><OrderBy><FieldRef Name=’ItemOrder’ Ascending=’TRUE’></FieldRef></OrderBy></Query><RowLimit>10</RowLimit></View>

Note that the number of items (Rows) to display on the site is specified in the <RowLimit>10</RowLimit> argument.

callbacktype Value for this type of instance = postdataload
dataloadproperties N/A for this use.
cache interval Sets the time (in secs) that the data should be saved in the local browser cache of the current user.

0 = do not cache the data for this widget

-1 = use the default caching strategy set in the Digital Workplace configuration

[whole number] = cache for specified time (secs)

VIEW For the Summary FAQ that appears on the Subsite Home Page:

View Name = Subsite-Home-FAQ

View Template URL =

/Style Library/DigitalWorkPlace/Content/Templates/GenericList/FAQ.html

 

For the FAQ Page that lists all the FAQ Questions (with no ALL QUESTIONS link):

View Name = Subsite-FAQPage

View Template URL =

/Style Library/DigitalWorkPlace/Content/Templates/GenericList/FAQPage.html

 

 

GenericList – Department Home Page News listing

 

Main Features

  • Displays the four most recent news articles from the current site (can be used on the parent or subsites)
  • Filters out news articles that are past their expiration date or before their start date
  • Includes link to the full news listing page

Uses List Definition(s): (click to view definition)

DeptNews_AK

GenericList – Department Home Page News Widget Properties Example Instance

 

Property Details
List is on root site If false, the list which contains the data for this instance is on the current site.

If true, the list which contains the data is on the root of the Site Collection.

selectfields The data fields (columns) from the SharePoint list that the widget should retrieve for use in this instance.

For this example, the selectfields = AnnouncementTitle,Image,FriendlyUrl

enable paging If false, the widget will not display paging controls

If true, the widget will display paging controls (if implemented by developer in widget)

items/page Sets the number of items to display on each page IF paging is enabled.
list name Name of the SharePoint list that contains the data to be displayed for this instance.
callbackmethod The callbackmethod is set by the developer of the widget.  For this use, the method to specify is “ShowDepartmentFeaturedNewsItems”
isasynccallback Value for this type of instance = false
viewxml The viewxml contains any special manipulation of the data that needs to be done by the widget BEFORE it gets render by the specified view.  In this case, the viewxml is set to the following string:

<View><Query><OrderBy><FieldRef Name=’Start_x0020_Date’ Ascending=’FALSE’></FieldRef></OrderBy><Where><And><Leq><FieldRef Name=’Start_x0020_Date’ ></FieldRef><Value IncludeTimeValue=’TRUE’ Type=’DateTime’><Today ></Today></Value></Leq><Or><Geq><FieldRef Name=’Expires’ ></FieldRef><Value IncludeTimeValue=’TRUE’ Type=’DateTime’><Today ></Today></Value></Geq><IsNull><FieldRef Name=’Expires’ ></FieldRef></IsNull></Or></And></Where></Query><RowLimit>4</RowLimit></View>

Note that the number of items (Rows) to display on the site is specified in the <RowLimit>4</RowLimit> argument.

callbacktype Value for this type of instance = postdataload
dataloadproperties N/A for this use.
cache interval Sets the time (in secs) that the data should be saved in the local browser cache of the current user.

0 = do not cache the data for this widget

-1 = use the default caching strategy set in the Digital Workplace configuration

[whole number] = cache for specified time (secs)

VIEW View Name = Subsite-Home-DepartmentNews

View Template URL =

/Style Library/DigitalWorkPlace/Content/Templates/GenericList/DepartmentNews.html

Was this article helpful?
Dislike 0
Views: 34
//]]>