Jump to content

alemachado

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by alemachado

  1. Hi @Soma $fields->get("body")->label; Seems to not consider the multilanguage label. Is that why it is out of $page context?
  2. 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
  3. Hi tpr I've just passed through the same problem. The solution is to give the location/name of your twig file as the second parameter. Ex: {{ __('my_string', 'home') }} for templates/home.twig or {{ __('my_string', 'includes/header') }} for templates/includes/header.twig
×
×
  • Create New...