789 Posts in 335 Topics by 301 members
|Go to End|
22 February 2013 at 1:34am
I have a function inside a Widget that should return all the members of a given group. However, it seems to be impossible to loop through this function inside the widget. Once I put my function inside Page.php and loop through it in Page.ss I get the expected results. Putting it back in the Widget and nothing happens. How to get the widget to show the output aswell?
The code I am currently using (function getMembers):
I also tried $getMembers, but it was also useless. Any help is appreciated!
26 February 2013 at 10:04pm
Thanks to g4b0 on the IRC the issue is resolved.
Putting the function getMembers() in a controller made it work
22 May 2013 at 8:22pm
+1 for oceanmountain's solution!
This had been driving me crazy for ages as for some reason I was only seeing the issue (an empty widget which just showed the widget title and no content returned) when I had multiple widgets on the same page.
Even then if I had the widget at the top of the widget area (the first widget on the page) it would still work fine with the method in my model class rather than in my controller class :-S
Regardless as described above moving my method to the controller for all my widgets has solved the issue
23 May 2013 at 12:38am Last edited: 23 May 2013 11:19am
Hello HARVS1789UK and oceanmountain,
I'm having the exact problem that you describe. Could you please explain mit some more detail how to solve the issue with this controller method? Unfortunately I'm not savvy enough to imply the concrete steps. Would really appreciate it!
Thanks for your time!
|Go to Top|