joe_g Posted October 7, 2014 Posted October 7, 2014 Hello, this works: $user->language = wire("languages")->get("default"); $p = new Page(); $p->parent = $pages->get('/things'); $p->template = $templates->get('mytemplate'); $p->title = 'blablabla'; $p->save(); ..but this doesn't (in pw2.4): $user->language = wire("languages")->get("english"); $p = new Page(); $p->parent = $pages->get('/things'); $p->template = $templates->get('mytemplate'); $p->title = 'blablabla'; $p->save(); i get Can't save page 0: /en/things/: It has an empty 'name' field any ideas how to get around this? J
Soma Posted October 7, 2014 Posted October 7, 2014 You have to set the default page name cause it's required.
joe_g Posted October 8, 2014 Author Posted October 8, 2014 I could do this I guess, and then the name will be calculated? $default = wire("languages")->get("default"); $p->title->setLanguageValue($default, 'blablabla'); thanks, j 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now