AndZyk
Members-
Posts
678 -
Joined
-
Days Won
10
Everything posted by AndZyk
-
Translated strings not showing up in frontend
AndZyk replied to Hurme's topic in Multi-Language Support
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 -
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. ?
-
Including files that are in sub directories - issues
AndZyk replied to ZionBludd's topic in Getting Started
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"); -
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
-
@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
-
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. ?
-
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
-
Nice website and really unique approach for building it. ? Just my opinion, but you should consider that in the case you ever want to switch the framework or build the website with a different structure, that I think great parts of your setup will become obsolete. Not that it is likely, because with the UIkit framework you have made a excellent choice as framework, but this approach is maybe not really future proof because it heavily depends on one framework. Also, if you haven't already, it would be best to use unique titles for everything (fe. sections, slideshow etc.), because otherwise using the page search will be difficult. I had a similar setup years ago with Page Tables (nowadays I prefer Repeater Matrix) and it was hard to find the right element, because I had named everything similar. ? Regards, Andreas
-
Internal Server Error 500 - Strato Shared Hosting
AndZyk replied to AndreasWeinzierl's topic in Getting Started
TracyDebugger and Xdebug don't work well together in my experience. So you have to choose one or the other. If you want to use Xdebug in your IDE PHPStorm, then you should uninstall TracyDebugger. If you want to use TracyDebugger, then you should deactivate Xdebug. I would recommend TracyDebugger over Xdebug. I have just read that it should work nicely together with Xdebug. Although I have made a different experience, you can ignore the first part. You can make Dumps like described in the blog post or documentation. Personally I prefer BarDumps, because they have their place inside a panel and not on the page. But it is up to you. I have never used breakpoints and it seems that you cannot set breakpoints like with Xdebug inside your IDE. If that is important to you, then you should stick with Xdebug. -
Or Bitbucket Snippets if you have an account there. ?
-
In this example, if you already know that you need one field type multiple times, you could just use a repeater field. Inside this repeater field you could repeat a textarea field and maybe a page title field for better labeling the repeater items. That would be three fields in total instead of maybe 50. ? I know it is not always that easy but repeaters and the repeater matrix is one possibility to reuse fields on the same template. You could shorten this to: <?php if ($page->texarea_number_3): ?>
-
Hello @DarsVaeda, I always try to reuse as many fields as possible so I don't end up with too many fields. I usually make one field for a textarea, a text, one image, multiple images etc. Tagging them as mentioned helps you to keep them organized. If you ever need multiple fields of the same type in one template, you can always make specific fields, but most of the time you can avoid this by using general fields. I know this is just an example, but why would make fields for a form in the first place? Will the titles or placeholders of the inputs change and therefore should be dynamic? For this you could try the commercial module FormBuilder. But I think it is unlikely that the form will change much and therefore I would define everything inside the template. ? Regards, Andreas
-
Hello @DarsVaeda, the commercial module ProCache does this very well, even for assets. Every time you make changes to your styles or scripts, the merged and minified styles or scripts get updated with a new hash. I can really recommend this module. ? Regards, Andreas
-
I like the design. The search function is not working or am I missing something? Maybe a search function for a single page is not necessary. ?
-
If you are on a Mac, I can strongly recommend ff Works for encoding anything. It uses FFmpeg, which you can use via command line for free, but with a nice GUI. ?
-
Internal Server Error 500 - Strato Shared Hosting
AndZyk replied to AndreasWeinzierl's topic in Getting Started
This may be necessary on some hosters but definitely not on the hoster Strato. ? -
Internal Server Error 500 - Strato Shared Hosting
AndZyk replied to AndreasWeinzierl's topic in Getting Started
Welcome @AndreasWeinzierl, first of all I would recommend you to activate the debug mode inside your config file to get more informations about the error. Also you could install the excellent TracyDebugger to check your local installation for errors. This module saved me many time and I think it is a must have. Usually some hosters have issues with the RewriteBase. On those hosters you should set the RewriteBase in the .htaccess file to "/": RewriteBase / But with the hoster Strato this is not necessary. Most likely on your hoster Strato there is the SiteGuard write protection activated, which can cause issues. You should deactivate it for the directories where files need to be created and written (f.e. the assets folder). If none of this helps, there is a troubleshooting guide. Regards, Andreas -
Help with IMPLODE (different output of last page)
AndZyk replied to Hajosch's topic in Getting Started
Hello @Hajosch, you could also do something like this: <!-- Query of the authors --> <?php if (count($page->authors)) { echo "<u>AUTOR/EN</u>: "; foreach($page->authors as $authors) { echo "<a href='{$authors->url}'>{$authors->title}</a>"; if ($authors === $page->authors->last) { echo "."; } else { echo "; "; } } } ?> Regards, Andreas -
Thank you @adrian for confirming. I have opened a issue. ? https://github.com/processwire/processwire-issues/issues/642
-
First of all thank you @ryan for this great addition. I am a heavy user of the page search and use it more often than the page tree. ? I am not sure if this is a bug, but I think the new page search breaks the autocompletion of users: For example if I type in a username in the page search and select the suggested user, I will be redirected to the 404 page in the front-end with following url: http://example.com/processwire/access/users/username/ Instead the url should be something like this I think: http://example.com/processwire/access/users/edit/?id=123 Can anyone confirm this or is it maybe something on my side? I have noticed this on two different installations of PW 3.0.108. Regards, Andreas
-
Just a guess, because I have no virtual machine available, but maybe it has to do with the div.uk-inline before the actual image. This div.uk-inline and the div without classes before seem to have no use or am I missing something? I think you could remove them and see if this helps. ? Edit: It seems to be an issue with flex box.
-
Hello @justb3a, first of thank you for this and your other modules. ? I wanted to ask if it is possible for subscribers to let them change their preferences after the initial subscription? In my use-case I want to build a website, where subscribers can choose different newsletter channels via checkboxes (page field) on the initial subscription. This part is working fine, but after the subscription it is only possible for subscribers to change their preferences, if they unsubscribe and then re-subscribe. Could I provide a link with the ID or token and maybe a timestamp in the subscription email to a custom front-end form, where they can change and save their settings? It should be a verified and save address, so that no other user could guess the url and change settings of other users. I would be happy about some inspiration. ? Regards, Andreas
-
Hello @wbmnfktr, maybe I will give Structured Data another chance. I haven't tried anymore than I wrote in my initial post. You seem to be really experienced with Structured Data. If you have some examples or code snippets you would like to share, I think many people would appreciate it. ? Regards, Andreas
- 34 replies
-
- structured
- data
-
(and 2 more)
Tagged with:
-
Hello @MarcoPLY, I am glad this post helped you. JSON-LD is the recommended format for structured data. JSON-LD is JSON for Linked Data. Adding structured data with JSON-LD inside <body> is still valid, but usually it is placed inside <head> for better separation. Most of search engine specific code goes inside <head>. You could try the jsonld.js preprocessor, but I think it would be easier just to use PHP, since that is the easiest way to get data from ProcessWire. As far as I know is Google Tag Manager a different tool. Google Tag Manager is great for example online shops, where you want to track the customer experience. It seems to be an analytics tool for internal analytics, but has probably no effect on search results. But I have never used Google tag manager, just watched a few videos, so I could be wrong. Hello @dragan, Breadrcumbs has worked for me, although it is not very useful on websites with only one parent-page. ? Searchbox, Organization and Article hasn't worked for me. ? I don't think they will neglect structured data, but the support seems to be lacking. On Google I/O 2017 for example they announced upgrades to the Structured Data Testing Tool, but the upgrade doesn't seem to be available yet. In my opinion I am not that convinced of structured data compared to the time I have wrote this post. The extra effort is not that time consuming, but the results are a little bit disappointing. So I can totally understand if you don't want to bother with it. ? Regards, Andreas
- 34 replies
-
- 2
-
- structured
- data
-
(and 2 more)
Tagged with: