alemachado Posted May 13, 2019 Share Posted May 13, 2019 I'm using the Page Reference Field in a multilanguage Site. When the admin creates a new page through the field option on the template, the page is created without activate the secondary language. I've found this pretty old workaround (that works): https://github.com/ryancramerdesign/ProcessWire/issues/889 (in the current version, the hook goes on the row 884 of InputfieldPage.module): // ====================================================== // Hook to create new pages with languages active : // ====================================================== $trimmed_title = trim($title); $languages = wire("languages"); foreach($languages as $lang) { $page->title->setLanguageValue($lang, $trimmed_title); $page->set("status$lang", 1); } // ====================================================== I wonder if I'm making any mistake and there is some lost configuration. I suggest to enable the possibility to give the multilanguage field for the title when creating a new page through the page reference field. (I'm using ProcessWire 3.0.123) thanks Alex Link to comment Share on other sites More sharing options...
Zeka Posted May 13, 2019 Share Posted May 13, 2019 @alemachado processInputAddPages is a hookable method, so you can make a hook without modifying the core. Also, make sure that all languages are active on parent page where you add pages from the page reference field, I'm not sure that it gonna help/ 1 Link to comment Share on other sites More sharing options...
verdeandrea Posted February 11, 2020 Share Posted February 11, 2020 I have the same issue, but I also noticed another problem: Initially I had Italian as main language, but I switched to English as main one. Now the new pages created by PageReference are created with the name "untitled-xxxxxxxxxxxxx" (xxx = a series of number) and they have no Italian title so the page has an error cause it is missing the main title. Does anyone know if I am missing some steps or should I also look into processInputAddPages? 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