Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Widgets /

Discuss SilverStripe Widgets.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Widget in Footer.ss


Go to End


2435 Views

Avatar
Pulse

Community Member, 3 Posts

8 December 2014 at 4:40pm

I am wanting to including the lastest blog posts widget in my includes/footer.ss to display the lastest blogs posts there.

But for the life of me I can't get it to work.

I have:
silverstripe-blog
widgets
widget-latestposts

Latest posts display in my sidebar on all my pages. Yey. Did something right.

But I only just want to display the latest blog posts widget in footer, not all the sidebar widgets.

Have tried $LatestPosts etc etc - to no avail.

Silverstripe version 3.1.5

I read the widget github page: https://github.com/silverstripe/silverstripe-widgets

But the Rendering a widget individually puts my site in error once I put $SilverStripeFeed in my footer.ss

I am not sure if that page is current or not as :

s directed in the definition of SilverStripeFeed(), the Widget will be rendered through the WidgetHolder template. This is pre-defined at framework/templates/WidgetHolder.ss and simply consists of:

:::ss
<div class="WidgetHolder">
<h3>$Title</h3>
$Content
</div>
You can override the WidgetHolder.ss and Widget.ss templates in your theme too by adding WidgetHolder and Widget templates to themes/myThemeName/templates/Includes/

I had to put those files in templates includes from widget - but still did not work :(

I very eagerly hope there is a very easy fix to my problem.