Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/20/2023 in all areas

  1. This week we've got ProcessWire 3.0.211 on the dev branch. Relative to the current main/master version (3.0.210), this version is 20 commits ahead. Many of the additions are user-submitted pull requests, and there are also several minor issue fixes too. Full details can be found in the dev branch commit log. I'd been planning on merging InputfieldTinyMCE into the core on the dev branch almost right away, but with so many minor fixes and improvements being added (that don't need much testing) we may put out another main/master version first in the short term, and then merge in InputfieldTinyMCE. Thanks for reading and have a great weekend!
    6 points
  2. I saw differnt ways to handle ajax calls. I use 2. and 3.(for more complex projects) 1. Ajax folder with php files for each request, which include processwire index.php 2. URL-Hooks https://processwire.com/blog/posts/pw-3.0.173/#new-type-of-hook-for-handling-request-urls 3. AppAPI Module https://processwire.com/modules/app-api/ (Uses URL-Hooks or pageNotFound-Hook) 4. ajax.php template file https://github.com/kreativan/wirekit-core/blob/main/site-wirekit-core/templates/ajax.php 5. ajax request logic in each template file
    3 points
  3. PAGEGRID – A visual page builder for ProcessWire. Design fully responsive websites (or parts of them) without writing any code. Use ProcessWire's native templates (and fields) to create your own blocks. Rearrange and resize items in a visual way and use inline or modal editing to quickly edit the content of your website. Try PAGEGRID for free PAGEGRID is not free software. However, you can try PAGEGRID on your local machine or on a test server as long as you need to make sure it is the right tool for your next project. … and when you’re convinced, buy your license. Get it here Download from GitHub Download from Module Directory Requirements ProcessWire 3.0.210 or greater Installation Go to “Modules > Site > Add New“ in your admin Paste the Module Class Name "FieldtypePageGrid" into the field “Add Module From Directory“ Click “Get Module Info“ On the overview, click “Download And Install“ On the following screen, click “Install Now“ More install options Module install guide Site profile install guide Get up and running Quick start Create your own blocks or install the PageGridBlocks Module (installs premade templates and fields for PAGEGRID blocks). What's PAGEGRID? page-grid.com – Get to know PAGEGRID. Documentation – Read the official documentation. Issues – Report bugs and other problems. Forum – Whenever you get stuck, don't hesitate to reach out for questions and support. Why I build it ProcessWire is super flexible in itself and lets me build whatever I want. But building a custom website can be a lot of work. For some projects, I've ended up using a lot of templates and fields. To make my pages more flexible, I sometimes build my own little page builder based on the RepeaterMatrix or PageTable module. While these page builders were great for the specific site I was building them for, they were never flexible enough to be used for new projects, so I ended up customizing them frequently. The more complex they became, the harder it became to use them for my clients. After playing around with some WYSIWYG page builder tools, I realized that while they can save me a lot of time, they can also be very limiting or have expensive subscriptions and somehow tie you to their ecosystem. So I decided to build my own page builder based on the most flexible CMS I knew. Concept This fieldtype Renders block templates and adds drag and drop functionality in admin, as well as enable inline editing for text, and file fields. It also let's you manipulate CSS in a visual way to design fully responsive websites (or parts of them) without writing code. The fieldtype comes with an optional style panel to manipulate CSS properties directly on the page. You can customize the panel or disable it completely from the module settings (and just use a CSS file that you include in your template). The data to style the items is stored directly on the item using PW's meta data (no extra fields are created). Don't want to give your client all that power? Use ProcessWire’s powerful permission system to control what your clients can edit. You can then also grant access individually to the style panel, resize or drag functionality using ProcessWire's build in permission system. Features Blocks are just pages Blocks are defined by native PW templates and fields Manipulate CSS grid or flexbox based layouts in a visual way to design fully responsive websites (or parts of them) Encapsulated frontend code (PAGEGRID renders the template of your frontend inside an iframe in the backend) Design and editing features can be disabled for certain roles (using ProcessWire's build in permission system) Inline editing of text, textarea, TinyMCE (supports latest version), ckeditor and file fields Simply drag and resize to manipulate grid items directly inside the backend Manipulate grid columns and rows directly on the page (use any number of columns you want) All style manipulations are saved as JSON and used to generate dynamic styles that you render in your main template (no inline styles) Nested groups/grids (child pages of nested blocks are created under group parent) The style panel supports adding custom classes and assigning styles to them. These classes can be used globally on all pages (a css class is also a page) The style panel supports selecting html tags to style tags globally across the whole site Global blocks work with page reference field (changes on one page, changes all blocks on all pages) Manual and auto placement of grid items blocks and nested blocks can be cloned Redo/undo and copy/paste shortcuts Editing block items in modal sidebar immediately updates frontend (Ajax Save). Define custom icons for your blocks via native template settings (template -> advanced -> icon) Automatic page save (Changes are getting saved via ajax, no need to click the save button) NEW: Option to automatically load lazysizes lazyloader (V 0.1.0) Changelog V 0.1.0: Feature: Option to automatically load lazysizes lazyloader (Module Settings > Plugins). V 0.1.5: Fixed bug: Tabs not working when editing items via modal panel. V 0.1.6: Fixed bug: Setting height in VH unit was not working. V 0.1.7: Feature: Option to hide save button (and use automatic ajax save ) if there are no other fields than PAGEGRID on the content tab (Module Settings > Interface). V 0.2.0: Fixed bug: Custom block wrapper element <p> was not working with inline editor. V 0.2.0: Fixed bug: Inline editor would sometimes not save after clicking cancel and then edit item again. V 0.2.0: Feature: Now it's possible to add classes to elements inside richt text fields via style panel. V 0.2.0: Fixed bug: Inline editor was not working after first item was added to the page (needed reloading the page). V 0.2.1: Feature: Updated PageGridBlocks Module: Using TinyMCE as the default editor. V 0.2.1: Feature: Updated PageGridBlocks Module: Group/container wrapper element can now be changed to <div>, <section>, <article>, <header>, <footer>, <nav>. Thanks to everyone who helped me improve my coding skills and for the support of this great community! Special thanks to @diogo for the valuable feedback and @ryan for this great CMS and his support for the PageFrontEdit module!
    2 points
  4. // ready.php $this->addHook('WireLog::save', function(HookEvent $event) { // Prune all log files foreach(wire('log')->getLogs() as $logFile) { wire('log')->prune($logFile['name'], 7); } // Or just the current log file wire('log')->prune($event->arguments[0], 7); }); Not really tested ?
    2 points
  5. You might find this a better approach: https://processwire.com/blog/posts/pw-3.0.173/
    2 points
  6. Last week we released ProcessWire 3.0.210 main/master and it's been a very smooth launch. No new issues have appeared and all upgrade reports have been good so far. If you haven't yet upgraded I'd encourage you to. Last week's post covered a lot of what's new, in case you haven't seen it yet. Also be sure to check out the ProcessWire Weekly coverage of this new version. This week I've been focused on getting caught up with some client work but there have also been a few minor commits on the dev branch, with more on the way. I hope that you have a great weekend!
    2 points
  7. Happy new year everyone! New year, new module 🙂 A super simple color picker for the ProcessWire backend that can not only pick colors but also custom HTML (so you can use it for picking gradients, for example). Docs and Download: https://www.baumrock.com/en/processwire/modules/rockcolorpicker/
    1 point
  8. 140 commits, 55 resolved issues, dozens of new features, eight contributors, and five new pull requests make yet another great new version of ProcessWire. This week I’m happy to announce another new main/master branch version of ProcessWire, version 3.0.210. Like most main release versions, there is a lot here. This post covers some of the most notable additions and improvements— https://processwire.com/blog/posts/pw-3.0.210/
    1 point
  9. Ha just had another case today where I needed this and forgot I'd already worked it out once nearly a year ago ? This happens to everyone right? ?
    1 point
  10. ProcessLanguageFieldExportImport is a multi-language field export/import tool for ProcessWire This is a general support thread for the multi-language field export/import module in the modules directory here and as described in this blog post. This module is also designed to work with several of the ProFields multi-language types. VIP support for this module is available in the ProFields and ProDevTools support boards.
    1 point
  11. Yes, but $input->post helps only when the data got send as FormData. But you can post data also as json in the body of request (fewer code in JavaScript). Native PHP example for reading them: // Takes raw data from the request $json = file_get_contents('php://input'); // Converts it into a PHP object $data = json_decode($json); Looks like PW has no functions. So I will use the native solutions from PHP. No problem ?
    1 point
  12. My idea: cronjob call every day this script. // include index.php from pw foreach($log->getLogs() as $logFile) { $log->prune($logFile['name'], 7); }
    1 point
  13. https://processwire.com/api/ref/wire-log/prune/
    1 point
  14. I think if the sites should not access the same data, then it is best to use 2 individual installations. This way you are most flexible and you can use processwire "normally" ?
    1 point
  15. @bernhard could you please add PHP 8 as dependency for the latest Version 2.1.0. Thank you. Was updating a website today that still runs on 7.4 and got composer errors because mpdf requires PHP>=8.0.
    1 point
  16. This might be the right starting point for your question: https://processwire.com/docs/front-end/include/ Never used it, but it's possible to use ProcessWire outside of its natural space.
    1 point
  17. It definitely is. WireArray::filterData, which is responsible for executing the selector, does an explicit cast to (string) on the value. So it ends up with a literal "Array" instead of the values in childTemplates. This has the funny side effect that $templates->find('childTemplates=Array'); returns all templates. I'd call it a bug, since filterData seems to assume that all array-like values stringify to a pipe separated list like WireData, yet Selector::matches can deal with array values just fine. But since templates are loaded into memory anyway, you can just iterate over them and do a manual comparison without a performance or memory penalty. <?php namespace ProcessWire; $matched = []; foreach($templates as $t) { if( count(array_intersect($templates->childTemplates, [29,30])) ) $matched[] = $t; }
    1 point
  18. Just an idea based on similar queries I used in the past... totally untested for your use-case. $templatesFromPages = new PageArray(); // we go from here foreach($pages->find("template=news|events|otherTemplates") as $myPages) { // add template from found pages $templatesFromPages->add($myPages->template->name); }; With this you might be able to look for this: $templates->find("name=$templatesFromPages");
    1 point
  19. Well then it's an issue with TinyMCE that has nothing to do with ProcessWire. I'd try to see if there is already an issue for it (https://github.com/tinymce/tinymce/issues) and if not I'd report it there and ask for help.
    1 point
  20. Damn, I thought about gradient backgrounds the other day but totally forgot that today ? I've implemented the color blocks with SVG so I can't simply support gradients at the moment, but using DIV instead it will work: I'll refactor and add that tomorrow the other day! Then we have another distinction to other colorpickers ? ?
    1 point
  21. Yes, and to define them in code (which is a lot easier for automated deployments) and to get rid of any external JS library just for selecting a single color. That's exactly the use that I built it for ? Before: After: Not sure if there is any benefit here compared to creating two fields? What would be the exact use case?
    1 point
  22. Hi all, we are moving a site from TYPO3 to PW. The old site has all URLs end in .html. Is there a simple way to achieve this in PW without breaking things like urlSegments, pagination etc. ? It might be doable with a hook to Page::path but I think that will break urlSegments. Maybe instead of trying to achieve that goal it might be better to implement redirects. Has anyone done this before? Would be great to hear your opinions/experiences.
    1 point
  23. @gebeer The period "." is an allowed character in page names, so it's fine to have URLs ending with ".html" ... you would just make the page name end with ".html". You'd probably want to turn off trailing slashes for the templates used by those pages as well. If all URLs end with "index.html" then ProcessWire will take care of those redirects for you automatically, i.e. "/about/index.html" automatically redirects to "/about/" (unless there is literally a page named /about/index.html). If you want to migrate away from using the .html extension, converting things like /about.html to /about/ throughout the site, then it could be done with a redirect rule in the .htaccess file. If you want to have PW respond to either /about.html or /about/ in the same way, then the most direct way might be to add a $_SERVER['REQUEST_URI'] = str_replace('.html', '/', $_SERVER['REQUEST_URI']); at the top of your /index.php file. Though make sure you've got a <link rel="canonical" ... /> tag in your <head> so that search engines don't consider the about.html and /about/ two different URLs.
    1 point
  24. I have found the fix for this. It's easy. Just update ProcessWire to a newer version. https://github.com/processwire/processwire-issues/issues/1143
    1 point
  25. I don't think there's any obvious way around this: PHP considers namespace declarations and use statements (aliasing/importing) on a per file basis. (Technically this could be achieved by some sort of file complication scheme, but in my opinion issues with that approach would easily outweight potential benefits.) It's a matter of preference of course, but I often use full namespace (e.g. \Wireframe\Lib\Utils::some_method()) in my views. Just feels more intuitive to me, even if it does add a bit of verbosity ?
    1 point
  26. Here's a working example for you: <?php namespace ProcessWire; $showForm = true; if ($input->post->upload) { $tempDir = wire()->files->tempDir('userUploads')->get(); $uploaded = (new WireUpload('uploadedFile')) // same as form field name ->setValidExtensions(['txt', 'png', 'jpg', 'pdf']) ->setMaxFiles(1) // remove this to allow multiple files ->setMaxFileSize(10 * pow(2, 20))// 10MB ->setDestinationPath($tempDir) ->execute(); // $page = $pages->get(1234); foreach ($uploaded as $file) { $filePath = $tempDir . $file; // $page->files->add($filePath); echo $filePath . "<br>"; } // $page->save('files'); if (count($uploaded)) { echo sprintf("Uploaded %d files", count($uploaded)); $showForm = false; } } ?> <?php if ($showForm): ?> <?php // Adding enctype is crucial!! ?> <form method="POST" action="./" enctype="multipart/form-data"> <label for="uploadedFile"> Upload: <?php // suffix name with [] and add multiple attribute if you allow multiple files ?> <input type="file" name="uploadedFile[]" id="uploadedFile" multiple> </label> <div> <button name="upload" value="1">Upload</button> </div> </form> <?php endif; ?>
    1 point
  27. Just add .xml to the name ans disable trailing slashes.
    1 point
×
×
  • Create New...