Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/21/2020 in all areas

  1. There’s a new modules directory on the ProcessWire site now up and running. In this post we’ll cover a few details about what’s changed and what’s new. While last week's post introduced the modules directory, this post (part 2) focuses on newly added features for module authors (just pushed live today)— https://processwire.com/blog/posts/new-processwire-modules-directory/
    11 points
  2. I wouldn't ask to maintain multiple APIs. Just feel that making a link to Microsoft's github repo a required field is a bad decision. Like making github auth the default method for site authentication, not allowing email. What would happen to https://processwire.com/modules/pad-loper/ and alike, that cannot provide a github link? I would suggest making github a single option for automation, leaving plain textarea for description and url for project link a general option. That would probably suit everyone, making possible both code hosting platforms of choice and paid modules listing.
    3 points
  3. Markup Regions work by having markup appear before the opening <html> tag. Reference: https://processwire.com/docs/front-end/output/markup-regions/#technical-details-of-how-markup-regions-work So when hooking TemplateFile::render you would insert the HTML that will populate a Markup Region at the start of the rendered template file output, so it will appear before the contents of the auto-appended _main.php. Example: $wire->addHookAfter('TemplateFile::render', function(HookEvent $event) { $template_file = $event->object; $out = $event->return; // If the template file being rendered is basic_page.php... if($template_file->filename === $event->wire()->config->paths->templates . 'basic_page.php') { // ...then prepend the following Markup Region markup $my_region = <<<EOT <div id="body"> <p>Hello world</p> </div><!--#body--> EOT; $event->return = $my_region . $out; } });
    3 points
  4. @PCuser you need to let Sanitizer know what kind of clean-up to do, eg: $sanitizer->pageName($sportspage->title) will convert the title text to lowercase and replace spaces with hyphens to make it suitable for use in a URL (or HTML id attribute). See what other $sanitizer methods are available at https://processwire.com/api/ref/sanitizer/ PS: Page titles can change and also not be unique. I prefer to use a letter first (HTML ids must start with a letter) then use the page ID, eg s1234. Alternatively, you could use the existing page name rather than the title.
    2 points
  5. Hi everyone, I'm happy to present my latest project, which is a collection of guides and tutorials for web development with ProcessWire written by me. https://processwire.dev/ What is this? I have written several tutorials in this forum, and I wanted a central place to collect all my tutorials and put them in a logical order. processwire.dev is exactly that, a curated list of tutorials for different topics related to ProcessWire development. I have revised, updated and expanded most of my existing tutorials. There are also some completely new tutorials. Notable topics How to integrate Composer in your ProcessWire sites, and a general explainer for namespaces and autoloading. A two-part guide to using Twig with ProcessWire and adding custom functionality. How to create flexible content modules with Repeater Matrix fields and Twig. A general guide to performance optimization for ProcessWire. A starter guide for the "ProcessWire mindset" - how to structure your content. ... and much more! What's next? I hope this will be a useful resource to all of you fine people. Please note that these tutorials are very much opinionated, and they reflect my personal experience and development practices. So if you disagree with some of my conclusions, that's perfectly fine! I'm happy to discuss all my recommendations and approaches with you, so let me know if you have any feedback, suggestions or error corrections! I plan to expand this resource over time and already have some new topics planned. If you have suggestions for new topics, go ahead and post them here as well! Start reading now: processwire.dev
    1 point
  6. @PCuser there many ways to sanitise data using $sanitizer, eg pageName, digits, text, camelCase, etc, which is why you need to let $sanitizer know which method to use. They're all listed in the documentation. ?
    1 point
  7. While I kind of share your opinion on the vendor lock-in thing, I don't think this is going to be a big deal — as Ryan pointed out the vast majority already use GitHub, even though some popular modules are currently on GitLab. Looking at this from Ryan's point of view it's likely less work to develop (and maintain) features when you're using a single API rather than multiple... and if that helps Ryan keep things up and running, I think it's a good approach. Also personally every time I want to report an issue or send a pull request (or merge request in GitLab) it's a bit of a nuisance if the module is not hosted on GitHub. What I'm trying to say here is that since GitHub is the most popular option by far, as well as the platform we're using for core development, hosting third party modules there makes collaboration easier ? Regarding "own git" or "custom download URL" it's good to keep in mind that a lot of the data can be pulled automatically via GitHub API, and this would defeat that purpose. Custom download URL would also be potential risks in terms of security — public git repository, and preferably one with a GUI, is a must-have for this exact reason.
    1 point
  8. Using Tracy Debugger to dump the name of the submit button can give you a clue... $wire->addHookAfter('InputfieldSubmit::processInput', function(HookEvent $event) { $inputfield = $event->object; bd($inputfield->name, "inputfield->name"); }); So there are two submit buttons in Page Edit that get processed: the Save button and the Trash button on the Delete tab. Rather than hooking InputfieldSubmit::processInput you can use the dedicated hookable method that performs the save actions: $wire->addHookAfter('ProcessPageEdit::processSubmitAction', function(HookEvent $event) { $value = $event->arguments(0); if($value === 'send_registration') { // Do your action here... } });
    1 point
  9. @iNoize you are talking about SeoMaestro. But this is the thread for MarkupSeo module ?
    1 point
  10. TextformatterMakeLinks This Textformatter module is just a wrapper around the method fHTML::makeLinks from flourishlib (http://flourishlib.com/api/fHTML#makeLinks) The following description is basically just slightly modified copy from the official flourishlib documetation (http://flourishlib.com/docs/fHTML): The Textformatter will parse through a string and create HTML links out of anything that resembles a URL or email address, as long as it is not already part of an tag. Here is an example of it in action: If you put this text into a textarea inputfield which uses this textformatter Example 1: www.example.com. Example 2: https://example.com.'>https://example.com. Example 3: john@example.com. Example 4: ftp://john:password@example.com.'>ftp://john:password@example.com. Example 5: www.example.co.uk. Example 6: john@example.co.uk. Example 7: <a href="http://example.com">http://example.com</a>. The output would be: Example 1: <a href="http://www.example.com">www.example.com</a>. Example 2: <a href="https://example.com">https://example.com</a>. Example 3: <a href="mailto:john@example.com">john@example.com</a>. Example 4: <a href="ftp://john:password@example.com">ftp://john:password@example.com</a>. Example 5: <a href="http://www.example.co.uk">www.example.co.uk</a>. Example 6: <a href="mailto:john@example.co.uk">john@example.co.uk</a>. Example 7: <a href="http://example.com">http://example.com</a>. Downloadhttps://github.com/phlppschrr/TextformatterMakeLinks http://modules.processwire.com/modules/textformatter-make-links/
    1 point
×
×
  • Create New...