joe_g Posted October 7, 2014 Share 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 Link to comment Share on other sites More sharing options...
Soma Posted October 7, 2014 Share Posted October 7, 2014 You have to set the default page name cause it's required. Link to comment Share on other sites More sharing options...
joe_g Posted October 8, 2014 Author Share 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 Link to comment Share on other sites More sharing options...
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