Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/18/2024 in all areas

  1. View at: https://okeowoaderemi.com I switched to Processwire 10 years ago and it's being my goto framework for maintaining my website and also developing for clients. Development I used the moduleTemplateEngineFactory and TemplateEngineTwig, Twig has always been my favourite templating engine, because of how easy it is, to use reusable code and have an easy way to inject content into the layout, it's almost like MasterPages in .NET (For the Oldies)
    6 points
  2. For fun, I've been working on what you would call AdminThemeBootstrap to get a deeper understanding of ProcessWire's admin framework (maybe I'll release it one day but it's more of a pet project). As you may know, the current admin system has a deep dependency on jQuery and jQuery UI (which is now deprecated in maintenance mode). Things like the navbar dropdowns, tabs and accordions are jQuery UI based components, not (for example) UIkit's dropdown or Bootstrap's dropdown. This has gotten me thinking about if there was (not that it's necessary) a comprehensive re-thinking of the admin, what libraries in today's world would be the ideal fit for a project like ProcessWire?
    3 points
  3. Thank you for bringing this to my attention. Sorry to hear you're having trouble. This module hasn't been maintained for a long time. It definitely could need some love and care. Just a few days ago this came to my mind oout of the blue. I'm quite busy atm but hope that I can spare some time and look into this. But it may take another week or so.
    1 point
  4. @Didjee nice idea to keep in mind ?
    1 point
  5. Just a hint: $form->getValue('fileuploads') will output only the filenames. If you need the path to the filenames too, you can use the following method: $form->getUploadedFiles() Best regards
    1 point
  6. @ngrmm Please update to 2.1.58 - this version should fix your problems. Please add the new validator to your fileupload field: $fileuploads->setRule('uniqueFilenameInDir', true); The following method $form->getValue('fileuploads') should now show the sanitized and/or overwritten filenames as well. The full explanation of the additions can be read here in the Changelogs. As always, please take care if everything works as expected after the update!! ?
    1 point
  7. Here is the script: #!/usr/bin/php <?php namespace ProcessWire; include("/home/stephan/www/index.php"); foreach ($pages->find("template=post, status=unpublished, sort=unpublished, limit=1") as $post) { $post->removeStatus('unpublished'); $post->addStatus('published'); $post->save(); } With cron it is triggered once a day and it will look for unpublished posts. If there are any, the oldest post will get published. Simple as that. I am using this script to update my photo blog https://photos.stephansimonis.com more regularly. ?
    1 point
  8. Ok great, I found the issue and now everything makes sens! ??? Please grab the latest release of RockPageBuilder here https://www.baumrock.com/en/releases/rockpagebuilder/ and also upgrade RockMigrations to v3.35.5 The Problem was the removeFieldFromTemplate() method in RockMigrations. This method also removed global fields from any template if the "force" parameter was true. This operation made the title field non-global, which led to the problems we were seeing. Which makes sense now. Usually it's very unlikely that this ever happened but when working with RockPageBuilder you often have blocks that don't need a title field. That's the same for repeater fields, so I explored how it is done there. It would not be ProcessWire if there was not already a solution for it ? So I learned that every template has a "noGlobal" flag that you can enable and if that flag is enabled then global fields will not be added on template creation and it will also make sure that the RPB blocks don't make any problems if you remove any global field (eg the title field). That's a great update and makes RockMigrations a lot better. Thx for the reports and help with Debugging! Enjoy the new release and please mark the topic as solved ?
    1 point
  9. Thanks for debugging this. Although I can't reproduce it here I can see a solution - please update to v0.1.2 for the fix.
    1 point
  10. @teppo I just wanted to let you know this plugin saved my life today. Thank you for building it! I just became a sponsor :)
    1 point
  11. Hi, I created a new installation and tried to use the module, only it doesn't work for me if I put the field ImageReference inside the Repeater. Do I have to do anything to activate it? ty
    1 point
  12. You still have the "Unpublished" checkbox on the Settings tab and the "Pub" action button in Page List to deal with. Plus to be extra sure you can hook Pages::publishReady to prevent publishing by any means. Some hooks... // Remove publish button and unpublished checkbox in Page Edit $wire->addHookAfter('ProcessPageEdit::buildForm', function(HookEvent $event) { /* @var InputfieldForm $form */ $form = $event->return; /* @var ProcessPageEdit $ppe */ $ppe = $event->object; $page = $ppe->getPage(); // Return early if user is not an agent or it's not a restricted page if(!$event->user->hasRole('agent') || $page->template != 'property') return; // Return early if page is published if(!$page->isUnpublished()) return; // Get status field /* @var InputfieldCheckboxes $status_field */ $status_field = $form->getChildByName('status'); // Remove unpublished checkbox $status_field->removeOption(2048); // Get publish button $publish_button = $form->getChildByName('submit_publish'); // Remove button $form->remove($publish_button); }); // Remove publish button from Page List $wire->addHookAfter('ProcessPageListActions::getExtraActions', function(HookEvent $event) { $page = $event->arguments(0); $extras = $event->return; // Return early if user is not an agent or it's not a restricted page if(!$event->user->hasRole('agent') || $page->template != 'property') return; // Return early if page is published if(!$page->isUnpublished()) return; // Remove publish action unset($extras['pub']); $event->return = $extras; }); // Prevent publishing by any means $pages->addHookAfter('publishReady', function(HookEvent $event) { $page = $event->arguments(0); // Return early if user is not an agent or it's not a restricted page if(!$event->user->hasRole('agent') || $page->template != 'property') return; // Return early if page is published if(!$page->isUnpublished()) return; // Throw exception throw new WireException('You do not have permission to publish this page'); });
    1 point
×
×
  • Create New...