Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Disable statistics?

Our old forums are still available as a read-only archive.

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

Page: 1 2
Go to End
Author Topic: 5415 Views
  • Blackdog
    Avatar
    Community Member
    156 Posts

    Re: Disable statistics? Link to this post

    works fine for me.

    Object::addStaticVars('LeftAndMain', array(
    'removed_menu_items' => array(
    'statistics',
    'newsletter',
    'comments'
    )
    ));

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: Disable statistics? Link to this post

    Ya you had newsletters (plural) it should only be singular.

    It'll work for all of them, just a matter of testing the proper names.

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: Disable statistics? Link to this post

    That will only remove the statistics from the CMS view. If you want to disable statistics completely (eg stop keeping PageView counts) You need to remove the lines below (like lines 86-87) From sapphire/core/control/ControlController.php

    // Log page views
    // Statistics::collect(); add a // before Statistics::collect() like this or remove this completely

  • NickJacobs
    Avatar
    Community Member
    144 Posts

    Re: Disable statistics? Link to this post

    great, thanks....yeah I just put 'newsletters' because that was the name on the menu. & yes will, I did uncomment that line....thanks all.

  • fumble
    Avatar
    Community Member
    1 Post

    Re: Disable statistics? Link to this post

    (edit: Duh, I didn't see the second forum page with everyone else's reply)

    @galilee: For removing the newsletter links, I tried "newsletter" (singular, not plural) and it worked

    Object::addStaticVars('LeftAndMain', array(
    'removed_menu_items' => array(
    'newsletter',
    )
    ));

    -fumble

    5415 Views
Page: 1 2
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.