Search the Community
Showing results for tags 'new page'.
I'm trying to create a new page through a file outside of the PW system. require('path/to/index.php'); $p = new Page(); $p->template = 'basic-page'; $p->parent = '/about/'; $p->title = 'Title'; $p->save(); Error: Echoing $wire->config->urls->assets works. I'm executing the code from the command line.
Hi all, I am using Processwire to synchronize Albums form a Facebook Page into Processwire. Works like a charm! I'm using two loops to synchronize the albums One loop that creates a page that stands for the "album" One loop that stores every image within the album as a child of the "album" I experienced that this loop however only synchronizes the first 25 images. I was wondering, is there any kind of limitation that comes with the page creation API? I used the following script as posted before by Ryan if I'm not mistaking $p = new Page(); $p->template = "fb_image"; $p->parent = $pages->get("name=$id"); $p->title = $hash; $p->name = $hash; $p->save(); $p->fb_image = $image["images"]["source"]; $p->save(); Hope someone has the answer!
Hello, Ryan once said that PW will take care of creating a name for me and it will also number-increment the name (i.e. "page-name-2") if one already exists. But when I create in admin UI a new page with name 'test' (page with that name already exists) and click "Save" button I've got an error: Session: SQLSTATE: Integrity constraint violation: 1062 Duplicate entry 'test-1100' for key 'name_parent_id' TemplateFile: Unknown page My new page and its fields data is lost! It is a bug or a feature? I use PW 2.5.26.