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

Access to standard methods/ variable in a control command


Go to End


2 Posts   2397 Views

Avatar
PGiessler

Community Member, 47 Posts

26 May 2009 at 11:39pm

Hi,

I want to write a widget, which I can set different includes into my Sidebar. The php file of the widget works without any errors, but SilverStripe doesn't interpet <% include .... %>. I know, why this doesn't work. Maybe is there a chance to have access the global variable like CurrentMember in my control command.

<% control IncludeIn %>

<% include $Include %>

<% end_control %>

Best regards,

Pascal

Avatar
FungshuiElephant

Community Member, 57 Posts

3 June 2009 at 11:42am

Edited: 03/06/2009 11:44am

Write a function in your widget to output the html/text that you want.
Call that function from within the control loop.

Look at the HTML widget, it may do what you want. This forum contains instructions on getting it to work.