The Problem:
Recommended content widget was not honoring the checkboxes to limit the post types to display.
$core_v2_widget.GetCustomValue('contentType',''))
was returning a comma separated list of the selected values in widget
configuration and the out of the box widget script was expecting a query string.
The Solution:
This is the original code from the out of the box widget:
#set ($contentTypes = $core_v2_page.ParseQueryString($core_v2_widget.GetCustomValue('contentType','')).Values('Selection'))
Here is code that will fix the problem:
#set ($contentString = $core_v2_widget.GetCustomValue('contentType',''))
#set ($contentTypes = $core_v2_utility.Split(",", $contentString))
By recognizing the widget is returning a comma separated string, the widget will now apply the correct filters to the query.
No comments:
Post a Comment