Dallby Dallby - 2 months ago 13
PHP Question

Silverstripe: Top.PageControllerFunction not displaying

I am using the Silverstripe Twitter module. It has a page controller function called

LatestTweets($value)
Which obviously displays the latest tweets.

When I add the Latest Tweets function to the
Page.ss
template. The tweets display. Everything works fine.

I am also using shaedawson's blocks module. I have a 'grid' block. The Grid Block has a template (
Grid.ss
) In the Templates Folder (
templates/
). When I add
$Top.LatestTweets(3)
to the Grid Template, the tweets do not appear.

Can anyone explain why this is happening?

Answer

I figured this out. The reason why the "Latest Tweets" function was not appearing on my template, was because I had to extend Block_Controller

I added the following to my 'extension.yml' file:

Block_Controller:
  extensions:
    - TwitterExtension

I would like to be able to 'include' the "Twitter Feed" template in my Grid Template. However this works and will do for now.