Laegnur Posted November 16, 2023 Share Posted November 16, 2023 Hello I'm building a tag system for my personal page. I added a Page reference field to the posts template. This field allow create new pages from field. I'm using multi-language support and multi-language page names. So when creating a new tag into a post, it creates a page with that tag name value for all languages page names, but only activates the default one. Searching for a solution I found an issue on GitHub from 2015 multi-language on page reference field This suggest to edit the wire/modules/Inputfield/InputfieldPage/InputfieldPage.module to force the activation of all languages page names. Quote I temporarily fixed it by adding this to wire/modules/Inputfield/InputfieldPage/InputfieldPage.module On line 505, in ___processInputAddPages, I added : // ====================================================== $trimmed_title = trim($title); $languages = wire("languages"); foreach($languages as $lang) { $page->title->setLanguageValue($lang, $trimmed_title); $page->set("status$lang", 1); // ====================================================== I don't like to edit wire things. So, I ask, it's possible to do this same as module or another solution, other that manually edit the tag page after creation? Link to comment Share on other sites More sharing options...
bernhard Posted November 16, 2023 Share Posted November 16, 2023 Read https://processwire.com/talk/topic/4383-how-to-set-language-active-via-api/?do=findComment&comment=147564 and https://processwire.com/talk/topic/4383-how-to-set-language-active-via-api/?do=findComment&comment=235967 ? 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