Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

34 Excellent

About DV-JF

  • Rank
    Sr. Member

Recent Profile Visitors

3,998 profile views
  1. @Robin S Thank you works like a charm. Is it possible to add this module to the PW module directory? I've searched for it there but couldn't find it 😏
  2. I'm just wonderin because of last point from READE.me say: So I'thought this is already implemented. I know, just wanted to save some time 😁 I think it would be great to be relative flexible. Perhaps we may have a field (maybe a repeater could do) where you specify what kind of cookies your website serves. On each repeater there should be in my eyes some possibility to explain what the cookie does and why it is used. I also like the "Necessary" checkbox which can't be disabled. BTW: Great module, thanks for @adrian creating and @wbmnfktr for maintaining it!
  3. Hi, is it possible to display the notice as an overlay. I've only the possibility to choose "Fixed Overlay at Bottom of Page" I'm using Version 0.4.12 (dev branch) from @wbmnfktr github repo. Furthermore it would be really nice to have the ability to create more than one checkbox in order to allow users to pick cookies more specifily. See https://developers.deezer.com/ for an example. Many greets!
  4. Hey... I've found this post because I had to accomplish a similar task. @dadish thank you for sharing this code-example. If anybody stumbles up this post again I want to mention that there's a little error inside: Instead of you have to set the new language value like this: //Set the value of the field for to language $p->setLanguageValue($langTo, $field, $fromValue); See https://processwire.com/api/ref/page/#api-setLanguageValue Many greets!
  5. @dragan I don't have the permission to view this forum, could you please post the solution here?
  6. Push... No, ideas? @ryan may I asked you, if you could have a look on this thread and give me a little hint 🙂? Many greets!
  7. When I do bd(wire('languages')->getLanguage()); in my module, I get an error: Session: Method Languages::getLanguage does not exist or is not callable in this context
  8. Hi @Dzung it depends on how much you want to build on your own or how many conditions you want to have preset. There are many ways how a blog system could be build up. Just search the forum to get an idea. Perhaps this might be a good starting point for you: Many greets...
  9. @bernhard Thank you for creating the issue in repo.
  10. Hi, I've had the same problem. Have a look here, this helped me out: https://github.com/ryancramerdesign/LoginRegister/pull/4/commits/e678f0d87abf9c8e43028f3636aaedb5ee43359e Many greets!
  11. Hi, maybe I've found a bug, but there's a behavior I can't explain: I'm trying to hook into Pages::saveReady with following code example: https://processwire-recipes.com/recipes/extending-page-save-process/ <?php /** * Hook the saving of pages to add own processes. * * ProcessWire 2.x * Copyright (C) 2014 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://processwire.com * */ class HookAfterPagesSave extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'HookAfterPageSave', 'version' => 1, 'summary' => 'Hook the saving of pages to add own processes.', 'singular' => true, // Limit the module to a single instance 'autoload' => true, // Load the module with every call to ProcessWire ); } public function init() { // init() is called when the module is loaded. // saveReady is a hook after processing the previous changes of the page, // but just before those changes are saved to the database. // It's called for each page that's being saved, no matter if it's in // the backend or in your templates via the api. $this->addHookAfter('Pages::saveReady', $this, 'afterSaveReady'); } In the afterSaveReady() function I'm trying to get the language property of the user who saved that page, but instead of returning the correct user language the default language is always returned. <? public function afterSaveReady($event) { $userLanguage = $this->user->language; bd($userLanguage); $this->message("User Language: ".$userLanguage); }; Here's the output and a test with the console of TracyDebugger Any ideas? Should I open a ticket here: https://github.com/processwire/processwire-issues/issues ? Many greets!
  12. Which tab is initially activated depends on the chosen user language. See \wire\modules\LanguageSupport\LanguageTabs.module line 69: // determine the index of the tab for the user's language $activeTab = 0; foreach($this->languages as $index => $lang) { if($lang->id == $language->id) $activeTab = $index; }
  13. Hey girls and guys, I'll want to open this thread in order to discuss a main problem I've run into with following setup: I'm maintaining a site where different URLs are directed to the same folder. In site/ready.php the $user->language is set based on the $config->httpHost <?php /* Set language based on the domain and user is not logged in */ /* Slovenian */ if( $config->httpHost == "www.domain.si" || $config->httpHost == "domain.si" || $config->httpHost == "domain.si.local") { if (!($user->isSuperuser())) $user->language = $languages->get('si'); } /* German */ elseif( $config->httpHost == "www.domain.at" || $config->httpHost == "domain.at" || $config->httpHost == "domain.at.local" || $config->httpHost == "domain.ch" || $config->httpHost == "www.domain.ch" || $config->httpHost == "domain.de" || $config->httpHost == "www.domain.de") { if (!($user->isSuperuser())) $user->language = $languages->get('default'); } /* Croatian */ elseif( $config->httpHost == "www.domain.hr" || $config->httpHost == "domain.hr" || $config->httpHost == "domain.hr.local") { if (!($user->isSuperuser())) $user->language = $languages->get('hr'); } /* English */ elseif( $config->httpHost == "www.domain.eu" || $config->httpHost == "domain.eu" || $config->httpHost == "domain.eu.local") { if (!($user->isSuperuser())) $user->language = $languages->get('en'); } /* Italian */ elseif( $config->httpHost == "www.domain.it" || $config->httpHost == "domain.it" || $config->httpHost == "domain.it.local") { if (!($user->isSuperuser())) $user->language = $languages->get('it'); } The homepage (id=1) has following settings: As you can see German (Deutsch) is set as default language. Everything is working nice and fine and I'm really happy with this kind of setup but now there are some new requirements, which causes me quite a headache : I've to add some pages only in one or two languages (they should not be present in German) I've to create some editor roles that are allowed to only edit (can be done with https://processwire.com/docs/user-access/permissions/#multi-language-page-edit-permissions) & add pages to their specific language. What I've found out so far: The default language can't be disabled and must always be present (though this would be in my eyes the easiest solution) Creating my own "language select field" - example here: won't work in this case because I've to rely on the native languages in order to setup the right permissions for editors. There seems to be some solutionsbut I think these won't match for me because I've to think about handling editors and permissions, too. After searching and searching, scratching my head and searching and searching again, the only possibility that comes to my mind is to add another language for German and assign this language to the specific URL's instead of the default language. The advantages with this solution for me: I could activate or deactivate any language on any page Editors which are allowed to add pages can get the permission page-edit-lang-default without affecting the German pages. The disadvantages: All multi-language-fields will have an empty tab for the default language - this may irritate editors a lot Seems to me like a lot of work to do because I've to copy the language field nearly for 1000 pages/repeaters (maybe I'll find an SQL query) My questions: How would you handle this task? Could my setup be optimized in a completely different way? If I go for my solution (adding another language for German) would it be possible to hide the language tab for default language in any way? If some points aren't clear enough please don't hesitate to ask. Many greets...
  14. Hi, I'm using this kind of setup (https://processwire.com/blog/posts/language-access-control-and-more-special-permissions/#language-page-edit-permissions) in order to control the page edit permissions. Now I'm wondering if it's possible to hide the "none-ediable" language-tabs instead of striking them through. Many greets...
  15. Hi, I've found this topic due a hint from @Robin S here: One question is open to me: I'm wondering if it's possible to "manually create" an error in order to test if the code is running fine and everything works as expected? Could someone please give me a hint how to force the LoginRegister module to throw an error. Many greets!
  • Create New...