Jump to content

AndZyk

Members
  • Posts

    722
  • Joined

  • Days Won

    10

Everything posted by AndZyk

  1. Hello @zota, first of all it would be good, if you would show how you have build your navigation. Have you made a simple navigation with a foreach of all children linking to their url, like in this tutorial, or have you made something different? With no further information it is difficult to help you. ? Regards, Andreas
  2. No, that would not be duplicate content. Search engines (or Google as far as I know) are smart and see websites like humans. If there is some content invisible, they ignore it. Google uses for their search engine an older version of Chrome, so it can interpret JavaScript and media queries: Hiding/Showing content for different viewports with media queries is a common practice. For example take the Microsoft website: They use two navigations with the same content. One for desktop and one for mobile. You should do that, because as mentioned on the article I linked before: ?
  3. It is not bad for SEO. Duplicate Content on the same page will not be penalized. Only if you have it on different pages. Search engines ignore hidden content. ? User agent detection on the other hand could be bad for SEO I guess.
  4. I think most of the developers are lazy. That is the reason why I like Emmet. ? But Emmet can't rename the matching closing element, as far as I know. For that I use CMD + D or CTRL + Left Click on macOS for selecting the closing element. Thats a cool feature of the Auto Close extension. By the way, if you are not familiar with Emmet, I would recommend you to checkout the introduction. Especially for CSS it is a real time saver and easy to learn. Just type a few letters + tab. For example: bgc + tab = background-color. You can find all on the cheatsheet.
  5. I would do this: Backgrounds Use media queries, as you are already doing. Images Use the picture element for art directed images with media queries. That is what its meant for. Content Output all versions of the content in your template and use media queries to show/hide the versions for different devices. If you are using a framework, there are components for this use case: UIkit: Visbility Bootstrap: Display I would strongly avoid user agent detection. ?
  6. Emmet defnitely works with PHP files too. How do you expand with Emmet? I recommend using tab for the expansions: Inside your PHP file you write for example div, then press tab and it opens and closes the HTML tag <div></div>. ?
  7. Weekly radio show with Hip Hop, Future Beats, R&B, Soul etc. ?
  8. Looks like a interesting extension: Getting hints from Visual Studio Code ?
  9. Hi @Hurme, this would be an ideal use case for language-alternate fields, if you haven‘t heard of them.? Or if you dont‘ want to use them, you could try to disable, that if no translation exists, the default language will be used. But language-alternate fields would be better. Regards, Andreas
  10. If you want to build a JSON object with PHP, you should have a look at json_encode. That it is easier and cleaner than building it yourself. ? Regards, Andreas
  11. 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. ?
  12. Thank you very much for the hint. This is the reason why you should always RTFM. ?
  13. 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
  14. @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.
  15. 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
  16. 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. ?
  17. 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
  18. 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
  19. 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. ?
  20. 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");
  21. 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
  22. @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
  23. 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. ?
  24. 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. ?
  25. 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
×
×
  • Create New...