Jump to:

22972 Posts in 11596 Topics by 2824 members

General Questions

SilverStripe Forums » General Questions » control Page by PageType

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

Page: 1
Go to End
Author Topic: 231 Views
  • cSGermany
    Avatar
    Community Member
    37 Posts

    control Page by PageType Link to this post

    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

  • cSGermany
    Avatar
    Community Member
    37 Posts

    Re: control Page by PageType Link to this post

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

    231 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.