Jump to content

Page reference field and multi language page names


Recommended Posts


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.

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...