Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/12/2021 in all areas

  1. https://octo.github.com/projects/repo-visualization Interesting... This is PW's repo visualized: https://octo.github.com/projects/repo-visualization#explore-for-yourself (enter a repo and you'll get an interactive SVG)
    5 points
  2. I think you want to convert your field value to name format (no spaces, replace with underscores or hyphens) https://processwire.com/api/ref/sanitizer/name/ Something like $sanitizer->name($cenik->text1);
    2 points
  3. Hi. Not tested but should work $this->wire()->addHookAfter('LanguagesPageFieldValue::getStringValue', function ($event) { $value = $event->return; $languagesPageFieldValue = $event->object; $languages = $this->wire()->languages; $userLanguageID = $this->wire()->user->language->id; $chineseLanguageID = $languages->get('chinese')->id; $newFallbackLanguageID = $languages->get('english')->id; if($userLanguageID === $chineseLanguageID && !$languagesPageFieldValue->getLanguageValue($chineseLanguageID)) { $value = $languagesPageFieldValue->getLanguageValue($newFallbackLanguageID); if(!strlen($value)) { $value = $languagesPageFieldValue->getDefaultValue(); } }; $event->return = $value; });
    1 point
  4. Omg, so simple. ? It works perfect now. Thank you very much ? R
    1 point
  5. Hey, many many thanks! Works fine! Your support is extraordinary! ? ? ?
    1 point
  6. Hi everyone, Here's a new module that lets you control whether multi-language support is enabled at the page / branch level, rather than only per template. http://modules.processwire.com/modules/restrict-multi-language-branch/ https://github.com/adrianbj/RestrictMultiLanguageBranch This is ideal for a site with repeated branches using the same templates where only some need to be multi-language. I think it is confusing to provide multiple language inputs for fields when they are not required - it just bloats the admin interface for site editors. I am hoping to expand this module to allow selection of which languages are supported per page/branch, but I am waiting on @ryan's response to this request: https://github.com/processwire/processwire-requests/issues/54 - to me this would be even more powerful if you have a situation where certain branches need some languages and other branches need different languages. The module config settings shows a summary of the restrictions you have implemented, eg: This shows that we have started with the home page which disables multi-language on itself and all its children/grandchildren (because "This Page Only" is "False". Next we have the /report-cards/ page multi-language enabled, but no inheritance (because "This Page Only" is "True"). The only branch below this to have multi-language enabled is Guanabara Bay and all it's children etc will also be enabled. All other report card branches will be disabled because they will inherit directly from the config settings default status. The Settings tab for each page gives you three options: Inherit, Enabled, Disabled. The screenshots give you an idea of how the Inherit option works and the information it provides based on the status it is inheriting and from where. My goal for this site was to just enable multi-language support for the Guanabara Bay report card branch of the tree, as well as the home page and the /report-cards/ parent. All other branches have multi-language support disabled which makes content entry much cleaner. Hope you guys find a good use for it and I'll be sure to update with the ability to define which languages are available on which pages/branches if Ryan comes up with a core solution for changing the returned $languages. Please let me know if you have any problems / suggestions.
    1 point
  7. I have just found this module and once again am astonished at the scope of interest and productivity of @adrian! Whatever I am looking for years after I started using PW he already has a module for written when I was just messing around ? This one is the great example. But the module is not as perfect as it could be. There is an issue (see above) that does not allow it to work as desired. I just added my thumbs up for the issue on github that makes the enhancement of the module (and custom hooks too) possible. Bumping this thread, so those of us working with multi-language sites could give their thumbs too to move the issue forward (it was waiting for us for a long time)) P.S. Multi-language support is one of the PW's selling points, so I feel proud making any step to improvement in this field)
    1 point
  8. Relative to ProcessWire 3.0.182, today's version (3.0.183) contains about 30 commits and resolves 23 issues. It also contains various small tweaks and improvements throughout. For example, when editing the title of a page, it updates the headline as you type in the page editor (in Uikit and Reno admin themes). I think we've got another 1-2 weeks of these kinds of updates (resolving issues and minor improvements) before we release the next master version, and am currently thinking that version will carry version number 3.0.184. I'm also continuing work here on the page snapshots module I wrote about earlier, but am going to wait releasing it until the next master version is complete. If you have a chance to test out ProcessWire 3.0.183 on the dev branch, please let us know how it works for you, and especially if you run into any issues. Thanks for being here and have a great weekend!
    1 point
  9. In your config.php $config->prependTemplateFile = '_init.php';
    1 point
  10. As we see huge progress in terms of privacy (GDPR/DSGVO) over at PrivacyWire with this module, wouldn't it be an awesome addition to embed YouTube videos with the "no cookie" domain in order to allow even more privacy? I worked my way through to this in a hacky way (see below) in the past but maybe this could be an option some day in the official module itself. $embedCode = str_replace('youtube.com', 'youtube-nocookie.com', $data['html']);
    1 point
×
×
  • Create New...