Jump to content

moving page


Frank Vèssia
 Share

Recommended Posts

For any page where you want to move it, just get the parent page, and set the target page to have that parent, and save:

$page = $pages->get("/home/mypage/"); 
$page->parent = $pages->get("/"); 
$page->save();

or if you want to do it on one line. :) --

$pages->get("/home/mypage/")->set('parent', $pages->get("/"))->save(); 

You'd use the same method to change a bunch of pages:

$parent = $pages->get("/"); 
foreach($pages->find("parent=/home/") as $page) {
    $page->parent = $parent; 
    $page->save();
} 
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...