Jump to content

Copy content of page to another page


pwired
 Share

Recommended Posts

Hi,

I have a page called "projects" with only 3 fields: pictures, main-pictures and text. How can I copy the content of this page to another page called  "setup". This page has the same fields as the page "projects"

Link to comment
Share on other sites

Hi,

I found this piece of api code from Adrian and have modified it a bit to my needs:

$np = $pages->clone($page, $parent);
$np->of(false);
$np->parent = $pages->get('/zundapps/');
$np->title = 'Zundapps-opbouw9';
$np->name = 'zundapps-opbouw9';
$np->save();

It's doing exactly what I want. Thanks fly out to adrian.

  • Like 1
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...