• Content count

  • Joined

  • Last visited

Community Reputation

40 Excellent

About Nukro

  • Rank
    Sr. Member
  • Birthday 10/10/1996

Profile Information

  • Gender
  • Location

Recent Profile Visitors

2,791 profile views
  1. Wow @bernhard what an impressive work! The developer heart is blooming.
  2. I had tried and it looks like it's not supported. There is no Detail Tab / Textarea or something where you can add the PHP Code. I came up with a workaround using InputfieldMarkup and Hanna Code Tags. But still, thank you for your Support @kongondo. Greetings Nukro
  3. Hi @kongondo Very Nice Module you have created here! I have a question, would it be possible to use this module inside the Formbuilder somehow. Is it even supported by the Formbuilder? Greetings Nukro
  4. You could also try something like that: $styles = array("class1", "class2", "class3"); $recipes = $pages->find('your-selector'); foreach($recipes as $key => $recipe){ $class = (isset($styles[$key])) ? $styles[$key] : "default-class"; echo "<div class='$class'><img src='{$recipe->images->first->url}'></div>"; }
  5. Hi @kongondo Have you found some spare time to implement this feature? Greetings Nukro
  6. I tried to make a function, which I can fetch translations from a page by it's name field. Features of the function: Fetches translations from page title (multilanguage). Outputs an edit link to the Translation Page (doesn't output it when 2nd argument is false) When the translation page you are referencing is not found, it outputs an error and also the absolute path to the php file were the function was executed by using debug_backtrace function of PHP. Benefits of this approach: You have full access to the ProcessWire API in terms of manipulating the translation data Translations of single Strings in different languages are side by side (tabs) Searching of single Translations is easy with Listers (I know search of site translation files is supported in PW3 but not in PW2, and I am using PW 2.7.3) Usability is far better since the users doesn't have to fiddle around in the system languages itself. Possible disadvantages: Little overhead when using the function, since it always loads a page behind the scenes when the function is used. (I had used 8-13 function calls inside a template file and doesn't had noticed any performance issues (bless processwire)). function _gt($key, $edit = TRUE){ $link = ""; $tracemessage = ""; $string = ""; $translationPage = wire('pages')->get("template=translation, name=$key"); if($translationPage->id){ if($edit && wire('user')->isLoggedin()){ if(wire('user')->isSuperuser()){ $editlink = " <a style='color:green;' target='_blank' href='".$translationPage->editUrl()."'>[Edit]</a>"; } } $string = $translationPage->title.$editlink; }else{ if(wire('user')->isLoggedin()){ $trace = debug_backtrace(); $tracemessage = "(".$trace[0]["file"].")"; } $string = "<span style='color:white;background-color:red;padding:5px;'>[Not Found: '".$key."'] $tracemessage</span>"; } return $string; } Example: echo _gt("akkreditierung"); echo _gt("fachgebiete-doctor"); And when it fails to find the translation page:
  7. Hi Guys I have a problem with the Code Internationalization (Site Translation Files) in Processwire. I am using the method Ryan is describing in this topic and also the normal way of translating files. The weird behaviors are that translations are just gone after a change in the main translation file called _strings (uses Ryan method). Or some other weird behavior was, that the english translation of the _strings file were somehow ported inside the german _strings file. I really don't know what could cause this. Have ever witnessed something like that? I have made some thoughts about this whole Code Internalization thing in ProcessWire and I am thinking to go another way (don't get me wrong, it's perfect for small to mid projects but in my opinion it is just a overkill for big projects), because at the beginning the strings we needed to translate were splitted up in many files which produced many site translation files to translate per language. It was just to much and confusing for the customer (and also for me), so that we needed another approach. So I tried Ryans method with one central translation files. The problem with this one is that it also gets confusing since it is a very big amount of strings to translate and also the problems described above. So for know I will try to make approach to store the strings in Pages. All translations of a string would be stored side by side. I know that this is probably more complex behind the scenes but it is far easier for the customer (especially with ListerPro). And I also like the idea of having the translations inside the DB instead in form of Files. What are your thoughts about it? Have ever done something like that? Greetings Orkun
  8. Hi @kongondo I have an suggestion about a new feature addition for replacing media. Would it be difficult to add a Message/Popup when the user is replacing media? At the moment it just replaces the media without a Warning Message or something like that. It would be a nice addition, since it is a risky move to let the users not know, that they have changed something, because they would replace media without noticing it. Also my customer become aware of this. Greetings Nukro
  9. @kongondo Sorry I somehow get confused now. To my understanding the pagefileSecure works like this: pagefileSecure ON (The news template for example, which holds the image/file field has view access for guest users activated) Guest User can't access unpublished/trashed image/document file with the direct url to it. Guest User can access published image/document files with the direct url to it. (the media-manager templates which holds the image/file field hasn't view access for guest users) Guest User can't access any image/document file that comes from the media manager with the direct url to it. pagefileSecure OFF Guest User can access any(published/unpublished/trashed) image/document file (also the ones from the media manager) with the direct url to it (also the ones from the media manager).
  10. Hi @kongondo Does the $config->pagefileSecure setting work with your module together? I tried it and it looks like it always blocks the access for guest users also when page(media) is published. From a blog post about pagefileSecure: I have the feeling that it blocks always because the media pages live under the admin where no "guest" user has access? Am I right? Would it be possible to write a hook or something to support the pagefileSecure together with the Media Manager pages/files? Greetings Nukro
  11. Hi Guys I needed a Link Checker to find broken links on my processwire websites. So I searched and came across this tool called Integrity. I've tested a little bit und must say it is a very good piece of software. fast and free Nice clear UI Only available for Mac OS There is also an alternative mentioned on the Integrity Website for Windows User called Xenu's Link Sleut. Hope this helps at finding Broken Links on your websites. Greetings Orkun
  12. Hi @ryan I have used this way to translate all of my strings and it works ("has worked") good. But now I have encountered something. A Client of mine called me and said that all the translations from the _string.php for the default languages were gone when he had added the translation for two other strings. The new changed Strings weren't gone but all other were it. Do you perhaps know what could cause such a dangerous action? The _strings.php file has 80-90 Translations at the moment. Greetings Orkun
  13. Hi @adrian What can I do for the moment, that it works again with only the id? Are you planning to release an update soon? In terms of the shortlink tab I think it doesn't really serves for a purpose. Greetings Orkun
  14. Nevermind. It had to do with the field 'flagLangInherit'. I had set access only for superuser for this specific field to see and had forgot it to switch it back when the site was live...
  15. Hi @LostKobrakai & @BitPoet I have the feeling, that the hook to LanguagesPageFieldValue::getStringValue only activate, when you are logged in as Superuser somehow. Does anybody of you perhaps know why? Please it's very important.