Jump to:

23379 Posts in 18298 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » Bulk Change Page Type? - Solved

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: 579 Views
  • johnmblack
    Avatar
    Community Member
    61 Posts

    Bulk Change Page Type? - Solved Link to this post

    Is there a way to change the page type of a large collection of pages in one action?

    For example, if someone entered in 100 press release pages, and selected the wrong page type for every one of them, is there anything I can do besides clicking into each one individually and changing the type on the Behavior tab?

    I am familiar with sql, so if there's a relatively-safe backhanded way of doing it, I'm OK with that.

    Thanks,

    -John

  • swaiba
    Avatar
    Forum Moderator
    1786 Posts

    Re: Bulk Change Page Type? - Solved Link to this post

    this should work (i.e. UNTESTED)...

    UPDATE SiteTree SET ClassName='NewClass' WHERE ClassName='OldClass';
    UPDATE SiteTree_Live SET ClassName='NewClass' WHERE ClassName='OldClass';
    UPDATE SiteTree_versions SET ClassName='NewClass' WHERE ClassName='OldClass';

  • johnmblack
    Avatar
    Community Member
    61 Posts

    Re: Bulk Change Page Type? - Solved Link to this post

    @swaiba - Thanks, that was the approach that worked -- though I did where ParentID = X instead, since it was only one group of pages with the problem and not all pages of the first type.

    579 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.