Jump to content

Orkun

Members
  • Posts

    295
  • Joined

  • Last visited

Everything posted by Orkun

  1. Hi Guys Working now for several years with Sublime Text and lately I had made the decision to try out vscode and I must say that it is really cool. Feels really fast like Sumblime Text. I have a question about the code syntax highlighting. How can I say to vscode that it should treat *.module files as *.php files so that syntax highlighting of php is used for Modules? Edit: Nevermind - https://stackoverflow.com/questions/29973619/how-to-make-vs-code-to-treat-other-file-extensions-as-certain-language Kind Regards Orkun
  2. Hi @kongondo Sorry for my late answer. I could resolve the issue with renaming the audio pagename from "peter-fractures-lac" to "peter-fractures-lac-old" after I have done that somehow a new page was generated automatically called "peter-fractures-lac" with the same audio file like the "old" page ("peter-fractures-lac-old"). From now on I could upload images documents etc... and it worked fine. The Error "Empty file upload result" doesn't come anymore. I also removed now the new generated audio page and renamed "peter-fractures-lac-old" back to "peter-fractures-lac" and everything still works fine. Very strange behavior. - It was working OK previously I upgraded to 0.0.6 now. Thanks. Kind Regards Orkun
  3. Hello @kongondo Our users are getting the error "Empty file upload result" when trying to upload images, documents etc... But the image still gets uploaded successfully. After that i checked with Chrome dev tools the ajax response when uploading the placeholder image: I get this error: I searched for that page "peter-fractures-lac-37499" but only found the page "peter-fractures-lac". But it is a media manager audio page. It looks like the module is trying to create a new mm-audio page called "peter-fractures-lac" but since there is already a page with the same name this error happens. But the question is why is he trying to create a audio page when I am uploading an image? Processwire Version: 2.7.3 dev MediaManager Version: 0.0.9 JqueryFileUpload Version: 0.0.2 PHP-Version: 7.0.32 Kind Regards Orkun
  4. Hi Guys I don't know what I am doing wrong. I have a website with three languages. German (default), French and English. The homepage should be only visible on the default language. So i removed the check on french and english: But some children pages of home are active in the french and english language. Let's say I am on a children page in the french language, for example www.example.net/fr/lorem/. When I click on the Logo (linked to home) it redirects as expected to www.example.net/fr/ and outputs the content of 404 Error Page. What can I do, so that it redirects to the default version of home and not to a 404 Error site. I pasted this code to my home template but it only works when I am logged in: if(!$page->viewable($user->language)){ $session->redirect($page->localUrl($languages->getDefault())); } I have also tried to catch it with a Hook on ProcessPageView::pageNotFound: // hook on 404 page to render custom content or redirect $this->addHookAfter("ProcessPageView::pageNotFound", $this, "hookPageNotFound"); protected function hookPageNotFound(HookEvent $event) { $url = trim($event->arguments("url"),"/"); $page = $event->arguments("page"); // it seems when page is unpublished, we have no "url" from page not found hook if($page->is("unpublished")){ $url = $page->url; } // shortcut urls catch, if a page with "shortcut" matches requested url // we redirect to that page, sinmple and easy if($url) { wire('log')->save("test", $url); } } But www.example.net/fr/ doesn't trigger the hook... What I am doing wrong?
  5. Hi Guys Last time I got a psd file from a customer. I needed the Images from the psd file but I hadn't photoshop or gimp installed on my system (and I also don't wanted them to have since I don't like them). So I quickly searche a online tool where I could extract the images from the psd file and I found pretty fast https://studio.psdetch.com/. It worked great for me. I could select any image in the psd file and extract it with a click of a button, pretty easy. It looks like it has also some other features but I don't looked at it in detail. Hope this helps some of you. Greetings Orkun
  6. Hi Guys I am writing this topic to help others who also encountered this problem. Two days ago our customer wanted to have new Roles for their Translators. The new Users / Roles shouldn't have write access to the default language (german) tab of the multilanguage fields but for all other languages (french and english) they should have it. So I made a little research and found Language Page Edit Permission. I created three new permissions (page-edit-lang-default, page-edit-lang-en, page-edit-lang-fr). I gave this new language permissions to all of my other roles in the system which had page-edit permissions. After that I created a new "translator" role and gave it only the page-edit-lang-en & page-edit-lang-fr permissions. And it worked out great. The Translator Users could only edit the french and english tab of the multilanguage fields. So far so good. But after 1 day I got a call of one of the customers employees (editors role). They said, that they couldn't create any pages anymore. So I looked into the related role and template permissions and all looked good. So after some trial and error I found out the solution. The Parent Page -> Template (where normally the new created pages are living) needs also edit permissions and not only "add children" permission if you have installed language page edit permissions, so that the users can create pages again. I'dont know if this is a bug or if it's intend to be so. I was using Processwire Version 2.7.2. Greetings Orkun
  7. Hi Guys We are looking for an alternative to MailChimp for managing Newsletters, Subscribers, Campaigns, Lists etc... While searching for a new Tool I discovered Sendy. It looks like a decent Webapp/Newsletter-Tool to manage Newsletters, Lists, Subscribers, Campaigns etc... The Mails are sended with Amazon SES and it is way cheaper than Mailchimp. And it is also a self hosted Tool. Has someone some Experience and Opinions on Sendy in general and also in combination with ProcessWire (Module, Integration etc...)? Do you also know other Solutions / Alternatives rather than Mailchimp? Kind regards Orkun
  8. Nice site. Really like the minimalism.
  9. Hi @kongondo I previously encountered an error in the media manager because of a javascript section in ProcessMediaManager.js. This Code closeDialog = function(s=1000) { setTimeout(function() { //$('div.ui-dialog-titlebar button.ui-dialog-titlebar-close').click(); parent.jQuery('iframe.ui-dialog-content').dialog('close'); }, s); } cause this error on IE and older Safari Versions (9.1.2, It worked though in newer versions -> 11.1) for me: Because of this error the Media Manager doesn't worked correctly anymore (JS didn't function right like mm_top_panel was hidden etc...). I fixed it with changing it to this: closeDialog = function(s) { /*temporary fix*/ if(s === undefined){ s = 1000; } setTimeout(function() { //$('div.ui-dialog-titlebar button.ui-dialog-titlebar-close').click(); parent.jQuery('iframe.ui-dialog-content').dialog('close'); }, s); } Just wanted to draw attention to it since other people could also have this problem. I am using an older Media Manager Version (9.0) so please don't mind if this problem is already fixed in the newer versions of the module. Kind regards Nukro
  10. Hi Guys It would be awesome when all the resource about processwire (tutorials, docs, cheatsheet, recipes, videos, api, faq etc...) would be unified on one documentation website called "docs.processwire.com". The new site would gather infos & data from these resources: https://processwire-recipes.com/ http://processwire.tv/ https://www.pwtuts.com/ https://processwire.com/docs/ http://cheatsheet.processwire.com/ and would unified it on the final site https://docs.processwire.com. I think It is far more better to have one endpoint for all the processwire resources & wisdom then mutliple sites. This way it is far more easier to get into the processwire world and choosing processwire as the next main cms for further projects. The Documentation Site could perhaps look like this (it is just a mockup, so don't expect to much from me ):
  11. Perhaps bootstrapping Processwire inside the Slider Script. https://processwire.com/api/include/
  12. - Are you trying to learn something new (programming language, framework etc...)? - Are you trying to refactor code from past projects where you have written "bad/not so good" code? - Are you asking other employees for work or if you can help at something?
  13. Interesting Conference / Talk from Rasmus Lerdorf, creator of PHP.
  14. @tpr On plainjs.com are many pure js sliders. Your Tiny Slider is also there: https://plainjs.com/javascript/search/?q=slider
  15. Hi Guys Since I nearly always needed a Slider for my websites, I've searched for a Slider which I could use for every Project or better said for different scenarios. So It had to be a rich-feature, responsive and customizable Slider which could be adapted/changed hassle-free to different needs of customers. In the end I found this nice jQuery Slider Plugin called "Slider Pro" (don't worry, it is MIT licensed ) which I think fulfills all expectations above and it also works very well for me. Perhaps it is also useful for you. Github Link: https://github.com/bqworks/slider-pro/ PS: What kind of Sliders are you using for your projects? Do you build your Sliders from scratch? Greetings Nukro
  16. Wow @bernhard what an impressive work! The developer heart is blooming.
  17. 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
  18. 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
  19. 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>"; }
  20. Hi @kongondo Have you found some spare time to implement this feature? Greetings Nukro
  21. 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:
  22. 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
  23. 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
  24. @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).
  25. 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
×
×
  • Create New...