Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Laegnur

  1. Hello I am trying to use this module on a site. And I am getting the following error when trying to add a video to a page. - Param given by constructor is not valid gd resource Any clue what this is? [UPDATE] I replace the content of the folder ffmpeg-php inside the module, for a recent version of this library, and this solve that issue. And edit the line 114 of the file InputfieldVideo.module.php to prevent a PHP error about Implicit conversion from float to int From this $duration = gmdate("H:i:s", $media->getDuration()); To this $duration = gmdate("H:i:s", intval($media->getDuration()));
  2. 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. 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?
  3. Hello. In a client website, they have a form with all the Spanish provinces as Select options. The client want that when there is an address saved on client's profile, the form preloads it. The province is saved as text string on profile. So, I explode it, and get and an array with all the address parts. Now I'm trying to set the Select's selected value to the option with same name as the province part of the address but I'm getting an error: "Method InputfieldSelect::addOptionAttributes does not exist or is not callable in this context" What I'm doing wrong? $field = $modules->get("InputfieldSelect"); $field->label = "Provincia"; $field->attr('id+name','provincia'); $field->addOptions([ "Alava" => "Álava/Araba", "Albacete" => "Albacete", "Alicante" => "Alicante", ..... ]); $field->required = 1; $field->addOptionAttributes($direccion[3], array("selected"));
  4. Hello @bernhard thanks for your answer. Now I understand how to set the locale for each language in the module and was able to achieve what I wanted. Finally my date code would look like this $data = strtotime($publicacion->data_publicacion); $dateFormatter = \IntlDateFormatter::create( $languages->getLocale(), \IntlDateFormatter::NONE, \IntlDateFormatter::NONE, \date_default_timezone_get(), \IntlDateFormatter::GREGORIAN ); $contido .= '<time datetime="' . $publicacion->data_publicacion . '">' ."\n"; $dateFormatter->setPattern('EEEE'); $contido .= '<em>' . datefmt_format($dateFormatter, $data) . '</em>' . "\n"; $dateFormatter->setPattern('MMMM'); $contido .= '<strong>' . datefmt_format($dateFormatter, $data) . '</strong>' . "\n"; $dateFormatter->setPattern('dd'); $contido .= '<span>' . datefmt_format($dateFormatter, $data) . '</span>' . "\n"; $contido .= '</time>' . "\n"; And the final result:
  5. Hello On my project, I'm using the multi-language module to translate the site to 3 languages. Now I want to format the posts datetime on a custom way, and I found this method using date() to output weekday name, month name, and day number. But the output names are on English. What is the best way to set the locale for each language added in the multi-language module? $data = strtotime($publicacion->data_publicacion); $contido .= '<em>' . date('l', $data) . '</em>' . "\n"; $contido .= '<strong>' . date('F', $data) . '</strong>' . "\n"; $contido .= '<span>' . date('d', $data) . '</span>' . "\n";
  6. Hello That's what I get for not reading all the documentation. Thank you very much for clarifying this point.
  7. Hello. I'm almost a new user in Processwire. Now I'm adventuring myself into make a new website with this CMS, and adding multi-language support to it. I installed the site using the blank profile, and install later the language support modules. Configure 3 languages, and add fields, templates and pages with translated labels, all correct. But now, I have 5 strings across multiple template files that I need to translate. When I go to one of the languages, and build the phrase index it appears to find all the strings but when search for translatable files, it only find 4 string. The problematic string is the "_x('Developed by', 'developer')". What I'm doing wrong with this string?
  • Create New...