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.

All other Modules /

Discuss all other Modules here.

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

SS 2.3.2 and staticpublisher with subsite


Go to End


1857 Views

Avatar
linkoovi

Community Member, 12 Posts

25 January 2011 at 12:07pm

Hi,

I am having problem with this it just wont work.

I followed the instructions on http://doc.silverstripe.org/sapphire/en/reference/staticpublisher
but i get Error msg:

[User Error] Uncaught Exception: Object->__call(): the method 'subpagestocache' does not exist on 'Page'

 function allPagesToCache() {
            // Get each page type to define its sub-urls
        $urls = array();

        // memory intensive depending on number of pages
        $pages = Subsite::get_from_all_subsites("SiteTree");

        foreach($pages as $page) {
        $urls = array_merge($urls, (array)$page->subPagesToCache()); //Exception thrown
        }

        return $urls;
    }