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.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

control Page by PageType


Reply

2 Posts   296 Views

Avatar
cSGermany

17 September 2013 at 10:50pm Community Member, 37 Posts

Hi there,

I've just upgraded to SS 3.1 RC2

I want to control a Page by it's Pagetype, normally I'm using this snippet for it

   function PageType($class = 'Page') {
      Return DataObject::get_one($class);
   }

<% control PageType(HomePage) %>

But if I use this in the new SS i get the following error after flushing the page

if($caller) {
172             user_error($caller.' is deprecated.'.($string ? ' '.$string : ''), $level);   
173          } else {
174             user_error($string, $level);   
175          }

can someone tell me how to solve this?

Thx in advance

cSGermany

Avatar
cSGermany

18 September 2013 at 5:59pm Community Member, 37 Posts

to answer my own (silly) question.
I just need to use a loop instead of control