AndZyk

Members
  • Content Count

    351
  • Joined

  • Last visited

  • Days Won

    1

AndZyk last won the day on March 29 2016

AndZyk had the most liked content!

Community Reputation

503 Excellent

About AndZyk

  • Rank
    Sr. Member
  • Birthday 09/12/1987

Contact Methods

  • Website URL
    https://andzyk.de

Profile Information

  • Gender
    Male
  • Location
    Furtwangen, Germany

Recent Profile Visitors

2,576 profile views
  1. AndZyk

    Thank you for recommending Auto Close Tag and Auto Rename Tag. Especially closing tags drove me nuts the last weeks. For me it only works with ProcessWire functions, if I have added a folder with a ProcessWire installation to my workspace and saved the file somewhere in this folder before. Edit: As @bernhard mentioned, the built in Emmet does the same. Only thing missing for me was expansion on tab. So I don't need the Auto Close Tag extension.
  2. AndZyk

    Thank you very much for the hint. This is the reason why you should always RTFM.
  3. AndZyk

    Here is an example: My installed extensions are: advanced-new-file Apache Conf Dash fish-vscode German Language Pack Material Theme PHP Debug PHP Intelephense Project Manager sftp Trailing Spaces vscode-pdf
  4. AndZyk

    @kongondo and @bernhard I am happy, that you like Intelephense. I just installed it, because it was recommended in the plugins list and has many installations. It does indeed find many of the ProcessWire functions if you use the Functions API. Only thing confusing for me is, that it also lists every other PHP functions, which I don't need most of the time. I haven't made any configuration to this plugin yet or read the description. But I would be interested as well, if it would be possible to configure it to make it more specific for development with ProcessWire.
  5. AndZyk

    I was for a long time happy with Sublime Text and in fact I still am. But this deprecation note of my favorite Sublime Text theme convinced me to switch to another editor/IDE. I have made the switch to Visual Studio Code a few weeks ago and like it so far. There are a few things missing/confusing, but the switch was easy because most of the Sublime Text plugins I used are also available for VSC. Thank you for the snippets, but I was wondering about some things @kongondo: If I use the Functions API, are those snippets a improvement or should I count in this case on a plugin like f.e. Intelephense? Maybe you could make a extension out of those snippets? Regards, Andreas
  6. AndZyk

    Yes, when you try to output a image field from a module, hook or bootstrap script it is an array, even if you set it to single in the back-end.
  7. AndZyk

    Hi @cosmicsafari, your example is a string translation, which you can use for static texts. Those static texts are ussualy short texts inside your templates which don‘t change that often. What you are looking for are multi-language fields, which are editable on the pages in the back-end. Just convert a existing field to a language field or add a new language field. If such a language field is translated, you will see the translation in the front-end. Regards, Andreas
  8. Hello @Hurme, if your string tranlastion is in a template file, it should work like this. If your string is in a included or prepended file (f. e. _main.php), this doesn't work in my experience. For this you could use text domains inside your string translations. I used to have a single included file (translations.php) in which I collected all string translations and used a text domain to point all string translations to this included file: Anywhere: echo __("This will be translated", "/site/templates/includes/translations.php"); In translations.php __("This will be translated"); You could save the text domain into a variable so you don't have to write the whole path every time. Nowadays I'm thinking about using the ProModule Functional Fields for string translations only, because it gives you more freedom. For example if the original string translation needs to be changed, you have to edit it in your template and enter the translations again in the back-end, because they have lost the connection. With Functional Fields a editor can edit the translations and the original string without losing the connection. If you have the ProFields, it is worth checking out Functional Fields. You have to add those files with string translations manually via the "Translate files" button. You should see there every file with string translations, either in the "site" or "wire" folder. Regards, Andreas
  9. AndZyk

    I didn't saw, that this repository is archived. Also @Pierre-Luc was last active in this board in 2016, so maybe a PM would help. If he doesn't reply for a long time, maybe a separate language pack or asking a board admin to replace the current one would be the only possibility. Good luck.
  10. Adding to that, if you are using the Functions API, you could also use urls(). urls()->templates . "src/components/filename.php"; Or if you don't need to require you could try out wireIncludeFile. wireIncludeFile("./src/components/filename");
  11. AndZyk

    Hello @vincent, how about a pull request on the original GitHub repository? https://github.com/plauclair/pw-lang-fr/pulls You could ask @Pierre-Luc, if he would like to merge your pull request and update the language pack in the modules directory. Regards, Andreas
  12. AndZyk

    @ryan We also have these issues and those should really be changed of fixed if possible: Renewal We would like to renew three ProModules but have only renewal invoices for two of them, because one expired. Of course we messaged you, but as you are busy and don't always have time to respond, we don't have a new renewal invoice yet. If it is not possible to change this behavior, maybe more board administrators should be able to generate new renewal invoices. Download We are not able to download our previously bought ProModules, because our licenses have expired. We were able to help ourselves by downloading and saving them on our fileserver before, but as a customer I think it has to be possible to download your purchased ProModules. Maybe this could be solved by a dedicated download page in which you have to enter your license and after entering you get all downloads that were available in the time you have purchased the license. This could exclude newer downloads when your license has expired. Regards, Andreas
  13. Thank you for the hint, although I can't use URL segments, because the file will be generated and added only in the back-end.
  14. Thank you very much @BitPoet for this idea. Renaming the old file before adding the new file works great. Now the filename of the new one doesn't get changed. <?php if (count($page->fileField)) { foreach ($page->fileField as $pagefile) { $pagefile->rename("old_{$pagefile->basename}"); } $page->fileField->removeAll(); } I was searching for hooks but never thought of such a simple solution.
  15. Hello, I am not that experienced with hooks and was hoping if somebody could me with this task: I have a InputfieldFile in wich a single generated file will be added after checking a checkbox in the back-end and saving the page. This happens in the saveReady-hook of a page with a specific template inside a ready.php: <?php $this->addHookAfter("Pages::saveReady", function($event) { $page = $event->arguments(0); if ($page->template->name === "example") { if ($page->checkboxField) { $page->fileField->add($generatedFile); } } }); Now if a new file should be generated and there is already a file in this InputfieldFile, I would like to remove the previous file and replace it with the new one: <?php if (count($page->fileField)) { $page->fileField->removeAll(); } That works well so far. My problem is, that I want to add the new file with the same name filename.pdf. But when I remove the previous file and add the new file inside the same saveReady-hook, the previous file still exists until the page is saved and the name of the new file will be added a filename-1.pdf, because ProcessWire makes the filename unique when a file with the same name exists. My question is: Is there a hook or way to remove the previous file before the new file will be added to keep the same filename? I tried to unlink the previous file, but then the InputfieldFile doesn't always gets updated correctly and has one empty file and the new file. Regards, Andreas