Leaderboard
Popular Content
Showing content with the highest reputation on 09/25/2024 in all areas
-
I’m assuming you do something like this: <a href="<?=$manufacturer->url()?>#siding">Get Wood</a> Go to the template settings of the $manufacturer page’s template and in the URLs tab, set the slash option to “No”: This will make the url() method generate links without the trailing slash and it will stop redirecting to the slashed version. That said, I’m pretty sure the links should work either way.1 point
-
Can’t you autoload your Process module? https://processwire.com/docs/modules/development/#automatically-loading-modules If you set 'autoload' => 'template=admin' in getModuleInfo() the ready() method should be called on every request within the PW admin. You can then determine if your hooks are needed as you’re already doing. I'm not sure what you mean by this, but you can use $modules->get('TestUpdate') to get an instance of your module? Yes, you can use $config->urls->admin, for example, but since you're creating a Process module, you should be able to get the entire URL using $this->getProcessPage(). That should be way to go since users can theoretically move or rename your Process page (as well as the Admin itself). If you're inside a request to the Process page, it will get you the current Page. Otherwise it will get the first page using the Process.1 point
-
Cool to see a project about my home country but not in my home country! Greetings from Switzerland! A very cool blog you have there. Model trains bring me back to my childhood, we had a ton of Märklin trains and of course, most of them were Swiss trains 😍 I think many of us feel this way. Welcome to the family 😊1 point
-
It depends on what you want to achieve but basically with lazycron you specify a time interval target and whenever someone loads a page the lazycron checks if the interval has passed and then triggers its function. This means that depending on where you put the hook, it may check more often or not: if you put the code in a template, then the lazycron is checked only when a guest is visiting a page with this template. However if you put the hook in init.php (or ready.php) then the lazycron will be checked for every pageview, even the admin ones.1 point
-
Hi @Ivan Gretsky I have pushed a new branch into Github here: https://github.com/horst-n/WireMailSmtp/tree/php-namespace This is called version 0.8.0 and all PW-PHP-module-files are now added into the PHP namespace ProcessWire. So now the module only can be used with PW > 3.0.62 (after merging to master branch). All the backwards compatibility to starting PW version 2.4 is lost now. 🙂 Please, can you fetch the new version from the github dev branch and test it, if it helps with your errors and let me know? For me everything is working fine here. The normal sending, the DebugTests in Frontend and in Backend, etc. PHP 8.1 + 8.2 ...1 point
-
Sure 😀. The key thing is that I am coming from Windows (but also that have tried so many Linux distros before). A one-liner that sets things up for me is great! It is beautiful right of the box, fast and installs the tools I need. Sure, I could have configured things myself but that means hours of research. I want the cake now and later, if I want, I can try and find out how the cake was made or change the recipe. In addition, the name (and by extension the company) behind it. It gives me confidence that he has done the research behind his configuration decisions for Omakub. Then there's the manual. It is concise and well-thought out. It has helped me discover tools I didn't know existed such as Xournal++ and a bunch of shell tools. Finally, if I am feeling adventurous, the whole thing is on GitHub 😀.1 point
-
Search Corrections Suggests alternative words for a given input word. This can be useful in a website search feature where the given search term produces no results, but an alternative spelling or stem of the term may produce results. The module has two methods intended for public use: findSimilarWords(): this method suggests corrected spellings or similar alternatives for the given word based on words that exist in the website. stem(): this method returns the stem of the given word, which may give a full or partial match for a word within the website. The module doesn't dictate any particular way of using it in a website search feature, but one possible approach is as follows. If a search produces no matching pages you can take the search term (or if multiple terms, split and then loop over each term) and use the module methods to find alternative words and/or the stem word. Then automatically perform a new search using the alternative word(s), and show a notice to the user, e.g. Your search for "begining" produced no matches. Including results for "beginning" and "begin". findSimilarWords() This method creates a list of unique words (the "word list") that exist on the pages and fields that you define, and compares those words to a target word that you give it. The method returns an array of words that are sufficiently similar to the target word. For multi-language sites, the $user language determines which language populates the word list. Similarity The method ranks similar words by calculating the Levenshtein distance from the target word. Where several results have the same Levenshtein distance from the target word these are ordered so that results which have more letters in common with the target word at the start of the result word are higher in the order. Method arguments $target (string) The input word. $selector (string) A selector string to find the pages that the word list will be derived from. $fields (array) An array of field names that the word list will be derived from. $options (array) Optional: an array of options as described below. minWordLength (int) Words below this length will not be included in the word list. Default: 4 lengthRange (int) Words that are longer or shorter than the target word by more than this number will not be included in the word list. Default: 2 expire (int) The word list is cached for this number of seconds, to improve performance. Default: 3600 maxChangePercent (int) When the Levenshtein distance between a word and the target word is calculated, the distance is then converted into a percentage of changed letters relative to the target word. Words that have a higher percentage change than this value are not included in the results. Default: 50 insertionCost (int) This is an optional argument for the PHP levenshtein() function. See the docs for details. Default: 1 replacementCost (int) This is an optional argument for the PHP levenshtein() function. See the docs for details. Default: 1 deletionCost (int) This is an optional argument for the PHP levenshtein() function. See the docs for details. Default: 1 Example of use // The input word that may need correcting $target = 'dispraxia'; // Get the Search Corrections module $sc = $modules->get('SearchCorrections'); // Define a selector string to find the pages that the word list will be derived from $selector = "template=basic-page"; // Define an array of field names that the word list will be derived from $flds = ['title', 'body']; // Optional: override any of the default options $options = ['maxChangePercent' => 55]; // Get an array of similar words that exist in the pages/fields you defined // The return value is in the format $word => $levenshtein_distance $results = $sc->findSimilarWords($target, $selector, $flds, $options); Example result: stem() This method uses php-stemmer to return the stem of the given word. As an example, "fish" is the stem of "fishing", "fished", and "fisher". The returned stem may be the original given word in some cases. The stem is not necessarily a complete word, e.g. the stem of "argued" is "argu". If using the stem in a search you will probably want to use a selector operator that can match partial words. Method arguments $word (string) The input word. $language (string) Optional: the language name in English. The valid options are shown below. Default: english catalan danish dutch english finnish french german italian norwegian portuguese romanian russian spanish swedish Alternatively, you can use the ISO 639 language code for any of the above languages. Example of use // The input word $word = 'fishing'; // Get the Search Corrections module $sc = $modules->get('SearchCorrections'); // Get the stem of the word $stem = $sc->stem($word); https://github.com/Toutouwai/SearchCorrections https://processwire.com/modules/search-corrections/1 point
-
I have an account, I get the newsletter once in a while, yet there is something that makes it unusable for me. Maybe it's just that I can't consume any more sources of news, articles, tutorials, and all that. I focus more on posts and threads here, news from specific tools and services on X, some YouTube. That's it.1 point
-
The only log I have with entries at the relevant time is the error_log created by duplicator which I quoted in my OP at Edit - that is from the target host. There was no relevant log on the source host.1 point
-
Thanks @kixe! Why is this method undocumented I wonder? I'd love to know the criteria by which a method makes it into the API docs or not. I'd like to see all class methods documented. If the PhpDoc comments are already there (as they are in most cases) then where's the harm in making the information viewable in the API docs? @ryan?1 point