How can I call a function of the parent of the actual class inside my template.
This try failes miserably:
<% control $Parent.MyFunction() %>
... doe doe doe ...
<% end_control %>
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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.
How can I call a function of the parent of the actual class inside my template.
This try failes miserably:
<% control $Parent.MyFunction() %>
... doe doe doe ...
<% end_control %>
Try
<% control Parent %>
// code in here is now working with the parent of the current page
<% end_control %>
Hope this helps,
Ben