Good afternoon,
I've created two widgets, one that lists all pages of "HealthPage" type and provides a jump box and a second that lists all pages of "NewsPage" type.
Both widgets work fine if they are the only widget on the page, as soon as I add the other widget the widget that renders second will fail.
HealthPage Widget
class HealthDropDownWidget extends Widget {
public static $cmsTitle = 'Health Drop Down';
public static $description = 'A clickable drop down menu for quick navigation to health pages.';
public function HealthPageList() {
return DataObject::get("HealthPage", "Status = 'Published'", "Title");
}
}
HealthPage Template (trimmed)
<select onchange="javascript:window.location.assign(this.value);">
<option selected="selected" >Jump to section...</option>
<% control HealthPageList %>
<option value="$Link">$Title</option>
<% end_control %>
</select>
NewsPage Widget
class NewsWidget extends Widget {
public static $cmsTitle = 'News';
public static $description = 'Displays the latest news stories.';
public function NewsList() {
return DataObject::get("NewsPage", "Status = 'Published'", "Date");
}
}
NewsPage Template (trimmed)
<% control NewsList %>
<div>
<span>$date.Nice</span>
$Content
<a href="$Link">Read more...</a>
</div>
<% end_control %>
I've tried the same code on a fresh database and I had the same issues.
Any help is appreciated.
Cheers,
James Bench