Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/29/2024 in all areas

  1. @nurkka - I agree, but a couple of things that might help you in the meantime. If you install https://processwire.com/modules/module-settings-import-export/ it will automatically backup module settings when it's uninstalled so that you can easily get settings back where they were when you reinstall it. Also, Tracy's Module Disabler panel can be helpful to disable modules without uninstalling - the catch is that it needs advanced and debug modes turned on to work.
    7 points
  2. Hi all, my proposal is, that every module should have an "active" checkbox, which allows to quickly deactivate it, instead of being forced to uninstall/reinstall it. Like AdminOnSteroids had and TracyDebugger has. Best regards!
    5 points
  3. When $config->debug and $config->advanced are true there is an "Autoload disabled" checkbox available in the module info for any autoload module. Checking this box disables the module in the same way as Tracy's Module Disabler panel, but might be useful on a site that doesn't have Tracy installed.
    3 points
  4. Hey man, I coined that term! (patent pending! j/k) I would really love to hear your Laravel/ProcessWire experience and comparison in terms of web application development. I too have been working on a very large webapp with ProcessWire over the last 6 months using ProcessWire, Alpine and HTMX (no need for Tailwind since it's completely admin side, although I did nearly completely develop AdminThemeBootstrap as an experiment during this project which I may or may not use in the future on it).
    3 points
  5. Version 2.0.16 now released. This comprises mosly bug fixes after extensive testing on some really complex migrations involving many templates fields and pages. In particular, the module will automatically carry out multiple migration installations to deal with the problem of circular dependencies between changed objects. Not sure how many people are using this module, but any feedback is welcome.
    2 points
  6. I like this thread, so I'm back to bump. Everyone has stacks! MEAN, MERN, TALL, LAMP, MEVN, RSTY, VILT, FLIP, PILF, DUMB, HALP... stacks are neat! It's cool when you can make a word out of tools! It makes it easier to argue over! I made some of those up! I'm planning out my current project and it needs a stack, or I'm not a Real Web Developer™ What is that stack you (didn't) ask? PATH. I'm putting the finishing touches on a full stack application I built over the last month using the TALL stack (Tailwind, Alpine, Laravel, Livewire). I've been jumping back and forth between that and ProcessWire and may write a post about the experience (when I can finally get enough time to do it). I've seen talk in the forums about ProcessWire alongside other tools like Laravel and want to share some firsthand information as far as differences, similarities, comparing how each handles the same task, when to consider one over the other, and takeaways that are going to influence how I use ProcessWire on upcoming projects. Also worth mentioning is how much I, and I cannot stress this enough, hate Tailwind and why I'm still going to use it. Before you ask, it's not because I can't spell "PATH" without the "T". I start out every project with research before writing code and in this case it's been a deeper dive into htmx. Along the way I have been reading Hypermedia Systems, a book written by the authors of htmx. It's free to read online, and I recommend it to everyone here. The contents of the book take the web back to basics, understanding it's core technology, and the importance of extending it's functionality, rather than fight it the way that client-heavy tools like React have chosen to do. PHP and PHP developers have a lot to gain from this approach and embracing that mentality, even if you choose not to use htmx. While my "stack" comment was a little flippant, the fact is that you can build ProcessWire applications and sites with dynamic content that provides an SPA-like experience without the SPA which is better for users, much more efficient, and provides a far better developer experience. Towards the topic of this post, I can't help but notice the continual renewed interest in alternatives to JavaScript as a full stack solution and to an extent (as noted in the videos above) an uptick in consideration for PHP as something to consider. As also discussed above, how much JavaScript fatigue is turning into JavaScript burnout. Anyway, here's a hot take by Theo that looks cold in comparison to the heat people are bringing in the comments calling him out (worth the click-through to read). One of the things that Laravel and ProcessWire have in common are modularity and the number of powerful tools built into their APIs, something I think about when hearing conversations about other PHP frameworks. So, bump in relevance to this video. You can already tell this guy is going to miss the mark because he doesn't have a Lamborghini in his preview pic SMH.
    2 points
  7. Presentation Originaly developped by Jeff Starr, Blackhole is a security plugin which trap bad bots, crawlers and spiders in a virtual black hole. Once the bots (or any virtual user!) visit the black hole page, they are blocked and denied access for your entire site. This helps to keep nonsense spammers, scrapers, scanners, and other malicious hacking tools away from your site, so you can save precious server resources and bandwith for your good visitors. How It Works You add a rule to your robots.txt that instructs bots to stay away. Good bots will obey the rule, but bad bots will ignore it and follow the link... right into the black hole trap. Once trapped, bad bots are blocked and denied access to your entire site. The main benefits of Blackhole include: Bots have one chance to obey your site’s robots.txt rules. Failure to comply results in immediate banishment. Features Disable Blackhole for logged in users Optionally redirect all logged-in users Send alert email message Customize email message Choose a custom warning message for bad bots Show a WHOIS Lookup informations Choose a custom blocked message for bad bots Choose a custom HTTP Status Code for blocked bots Choose which bots are whitelisted or not Instructions Install the module Create a new page and assign to this page the template "blackhole" Create a new template file "blackhole.php" and call the module $modules->get('Blackhole')->blackhole(); Add the rule to your robot.txt Call the module from your home.php template $modules->get('Blackhole')->blackhole(); Bye bye bad bots! Downloads https://github.com/flydev-fr/Blackhole http://modules.processwire.com/modules/blackhole/ Screen Enjoy
    1 point
  8. I created a script for TinyMCE that calculates the readability of a given text using the Flesch Reading Ease formula based on a 0-100 scale. A high score means the text is easier to read for users (recommended score 60+). Low scores suggest the text is complicated to understand with too long paragraphs. It works with standard TinyMCE, however the question is how to make it run with ProcessWire? tinymce.init({ selector: 'textarea#template', plugins: 'readability', toolbar: 'readability', menubar: 'tools', menu: { tools: { title: 'Tools', items: 'readabilityTool' } } }); tinymce.PluginManager.add('readability', (editor, url) => { editor.ui.registry.addButton('readability', { text: 'Readability', icon: 'book', onAction: function() { const content = editor.getContent({format: 'text'}); const readabilityScore = calculateReadability(content); alert('Readability Score: ' + readabilityScore); } }); editor.ui.registry.addMenuItem('readability', { text: 'Readability', icon: 'book', onAction: function() { const content = editor.getContent({format: 'text'}); const readabilityScore = calculateReadability(content); alert('Readability Score: ' + readabilityScore); } }); editor.ui.registry.addMenuItem('readabilityTool', { text: 'Readability', context: 'tools', icon: 'book', onAction: function() { const content = editor.getContent({format: 'text'}); const readabilityScore = calculateReadability(content); alert('Readability Score: ' + readabilityScore); } }); return { getMetadata: () => ({ name: 'Readability' }) }; }); function calculateReadability(text) { var sentences = text.split(/[\.\!\?]/).filter(Boolean); var numSentences = sentences.length; var words = text.split(/\s+/).filter(Boolean).length; var syllables = 0; var wordArray = text.split(/\s+/).filter(Boolean); wordArray.forEach(function(word) { syllables += countSyllables(word); }); if (words > 0 && numSentences > 0) { var wordsPerSentence = words / numSentences; var syllablesPerWord = syllables / words; var readability = 206.835 - (1.015 * wordsPerSentence) - (84.6 * syllablesPerWord); return readability.toFixed(2); } else { return 0; } } function countSyllables(word) { word = word.toLowerCase(); var vowels = 'aeiouy'; var numVowels = 0; var prevCharWasVowel = false; if (word.length > 2 && word.substr(-2) == 'es') { word = word.slice(0, -2); } else if (word.length > 1 && word.substr(-1) == 'e') { word = word.slice(0, -1); } for (var i = 0; i < word.length; i++) { if (vowels.indexOf(word[i]) !== -1) { if (!prevCharWasVowel) { numVowels++; } prevCharWasVowel = true; } else { prevCharWasVowel = false; } } return numVowels > 0 ? numVowels : 1; }
    1 point
  9. Thank you for the update. I did exactly that. The file permission of the .js file was the issue. There was no execution allowed. Now it works ? To calculate reading time I use this code on my website. 250 words per minute is the recommended value for English language. function calculateReadTime($text) { // Average reading speed in words per minute $averageReadingSpeed = 200; // Strip HTML tags and count the words $wordCount = str_word_count(strip_tags($text)); // Calculate the read time in minutes $readTime = ceil($wordCount / $averageReadingSpeed); return $readTime; }
    1 point
  10. After enabling it, you'd then need to add it. I copy/pasted your plugin's code into a file in my test PW site, followed my steps, but then also added it to the list of items in the toolbar. It (unfortunately) doesn't show up as a suggested item, so you have to type it manually and make sure you don't misspell it. Afterward, it should be enabled on your configured field(s). My field's Tools Menu is disabled, so I didn't test against that, but it does work, at the very least, for the toolbar/icon area when added.
    1 point
  11. Hi Bernhard, I removed RockFrontend.min.js because it's not needed as RockFrontend.js is already added automatically. The browser says it is related to the following line, certainly the only place where j is mentioned: (j = 0; j < attrs.length; j++) { I was just testing the rf-scrollclass attribute (with the css that is included in the docs): <footer class="tm-prose"> <div class="uk-container"> <div class="uk-text-right"> <a href='#' rf-scrollclass='to-top show-desktop@300 show-mobile@600'>Scroll to top</a> </div> ... I don't know the reason for the error message, so I'm just removing the attribute for the moment. I'll try again another time. Have a nice evening!
    1 point
  12. Hello @Andy The issue is fixed now inside Form.php Please replace this file with yours, if you do not want to wait until the next update: https://github.com/juergenweb/FrontendForms/blob/main/Formelements/Form.php BTW, the version on GitHub is actually 2.1.78 with a lot of new additions, but I have not updated the version number, because it needs a little bit more testing. So it is really cool, if users like you discover some problems before the version number will be updated ?
    1 point
  13. OK i see, please comment out line 2019 and 2022 if you need a quick solution. It seems there is an if-condition missing that checks if a CAPTCHA is enabled. I am not at home at the moment, so I cannot fix it directly, but I will do it in the next hour and give you an info. There is a lot of new code inside this file and some issues will pop up, so thank you for reporting this.
    1 point
  14. Hello @Andy I am a little bit confused at the error, because there is no declaration of the callback in line 1, but I will check this out. Please click on the tab " Markup and styling settings for the form" and at the bottom you will find the tab "Remove stylesheets and scripts". In this tab you can disable the embedding of the stylesheet and the Javascript file. Thanks for testing and reporting!! Best regards Jürgen
    1 point
  15. Hello @Juergen I continue to explore your excellent module. And I have a few more questions. Here is the error from the console. In continuation to this, I would like to know how I can disable the addition of frontendforms.css and frontendforms.js on all pages of the site? I'm only willing to add these calls myself to the page where I have the form in use. I can see that you are working hard on this project. Thank you very much.
    1 point
  16. This is more just a reminder post than a problem post. If you have been having issues building UIKit from more recent repos it may be because the math setting in the currently used LESS.php wikimedia version is a bit greedy. Even after setting the 'math' => 'strict' option in the $less object it still gave an 'Operation in invalid type error'. I forgot that I needed to modify two files in order to get this to compile. base.less and article.less have two variable calculations that need to be quote escaped. Basically you need to turn this: @base-h1-font-size-m * 0.85; into this: ~'calc(' @base-h1-font-size-m ~'* 0.85)'; No matter how many times I write this someplace I forget that it needs to happen. So I am saving it here for the next time I desperately search for it.
    1 point
  17. It may depend on how you define your LESS variables, and whether you use CSS variables or not. This is something that the Wikimedia LESS and other frameworks run into from time to time - it's not unique to UIkit. Usually the strict math option resolves it because parenthesis are required to indicate math operators that LESS should evaluate - so I was surprised this was still choking, and it wasn't stopping on my custom mod LESS (partly because I had already quote escaped the math I needed to protect from LESS) - it was choking on stock UIKit source. The issue started for me with UIKit 3.18 I looked into whether the math setting changes may have an impact because of what others found on unrelated frameworks. In my particular case, I allow for dynamic type scaling in theme options based on variables, and I use dynamic font scaling to maintain line line lengths also. In my case when you allow LESS to do the math on its own it sometimes the parser is too greedy. I do wonder if using the up-to-date LESS.php package (I think it is 4.4.1 when I dug into it yesterday) would help, but I found it wasn't necessarily a direct drop-in for some reason. I ended up reverting to the default module.
    1 point
  18. but but but we told you to try with the same env, anyway glad to hear it's solved, this type of issue kill a kittie each day.
    1 point
  19. I read each of them, almost all with different situations/solutions (session.referer_check in php.ini, file permissions, disable CSRF, etc), with all in the forum trying to guess the solution, even some threads don't reach a final solution
    1 point
  20. Some screenshots (dark mode): Screenshots (light mode):
    1 point
  21. Hello @Andy I have tried to change the file permission of the root directory with the $files->chmod() method, but it does not work in this case. In addition it is always a little bit risky if you are changing file permissions via API. It could be a serious security issue if something went wrong. For this reason I have decided to warn the user, if the file could not be copied to the root. It works on my local installation but I would be happy if you try it at your environment and give me a short feedback, before I push it to Github for a new version. All you have to do is to replace the old createRemoveCaptchaImageFile() method inside the FrontendForms.module with this new one. protected function createRemoveCaptchaImageFile(bool $install): void { $moduleFile = $this->modulePath . 'Formelements/Captcha/captchaimage.php'; $rootFile = $this->wire('config')->paths->root . 'captchaimage.php'; $from = $install ? $moduleFile : $rootFile; $to = $install ? $rootFile : $moduleFile; if($this->wire('files')->copy($from, $to)){ if(!is_writable($to) && $install) { // captcha file could not be copied to the root folder $warning_text[] = sprintf($this->_('The captchaimage.php file could not be copied to the root directory (%s), because the root directory is not writeable.'), $this->wire('config')->paths->root); $warning_text[] = sprintf($this->_('Do not worry! To fix this issue, please move the file from "/site/modules/FrontendForms/Formelements/Captcha/captchaimage.php" to "%s" by yourself.'), $to); $warning_text[] = $this->_('Otherwise you will get an error if you try to use the CAPTCHA on your forms.'); $this->wire('session')->warning(implode('<br>', $warning_text), Notice::allowMarkup); } } // try to unlink the file on uninstall try { // unlink the captcha.php file $this->wire('files')->unlink($from); } catch (Exception $ex) { $this->wire('session')->warning($ex); } } The method checks at first if the copying was successfull. If not, it checks if the root is writeable -> if not it outputs a warning with further instructions. This should solve the problem. Thanks Jürgen
    1 point
  22. Cs-cart is my favorite. Really flexible, scalable and reliable. Exact as ERP and Akeneo as PIM
    1 point
  23. CSS awesomeness! Enter this into the "Text color" field in the module settings: transparent; width: 70px; height: 70px; border: none; background: transparent; border-radius: 100%; overflow: hidden; padding: 0; margin-right: 0.7em; color: #aaa Also set the first field value to "70,70". No matter what you write elsewhere, the code above will overwrite it.
    1 point
  24. Hi alexmercenary, I can confirm that the following works, and will indeed create a single page website where the child pages are included in the homepage, and are not accessible via URL. You don't need to set the child pages to hidden, the template logic takes care of the 404. In my home.php template <?php include("./head.inc"); foreach ($pages->get('/')->children() as $p) { echo $p->render('children.php', array('isPartial' => true)); } include("./foot.inc"); In my children.php template (assigned to all children of the home page) <?php if (isset($options['isPartial']) && $options['isPartial'] == true): ?> <section class="arrow" id="<?=$page->name; ?>"> <h2><?=$page->title; ?></h2> </section> <? else: ?> <?php throw new Wire404Exception(); ?> <? endif; ?>
    1 point
×
×
  • Create New...