Jump to content

adrian

PW-Moderators
  • Posts

    10,902
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. I think you might be confusing templates and pages. main.php would be template file that controls the output of pages with the "main" template, but usually main.php is used as based template that is included or modified by other templates. That aside, you need to get the repeater content from the page where it exists, so something like this: $p = $pages->get(selector to get page where repeater content is); foreach($p->repeaterfield as $repeateritem) { //usual repeater output }
  2. $page->blocks->render() will output the content of the selected blocks page based on its template. Does that do what you need?
  3. You need to specify what fields you want to output from blocks, so for example, $page->blocks->title
  4. A little humorous PW vs Drupal comparison https://www.slant.co/versus/14277/4267/~drupal_vs_processwire When comparing Drupal vs ProcessWire, the Slant community recommends Drupal for most people. In the question“What are the best web content management systems?” Drupal is ranked 2nd while ProcessWire is ranked 13th.The most important reason people chose Drupal is: A more complex Drupal installation can easily exhaust 256 MB of RAM with only one or two visitors.
  5. I agree that @Robin S solution is definitely the easiest if that works for you. But, if you do need to dynamically order with a hook, then this should work for you. Don't forget to change 'options_field_name' to the appropriate value. $this->addHookAfter('Field::getInputfield', null, function($event) { if($event->object->name == 'options_field_name') { $inputfield = $event->return; $options = $inputfield->options; foreach($options as $id => $title) { $inputfield->removeOption($id, $title); } asort($options); foreach($options as $id => $title) { $inputfield->addOption($id, $title); } $event->return = $inputfield; } }); I am a little under the weather today and I feel like I am missing an easier way to remove all existing options before sorting and adding them back. I feel like there is probably a better way to do this in general, but it doesn't look like you can use PW's sort() here. Maybe I am just not seeing it right now
  6. I just tested this using the "Text List" and "JSON settings" options and it should now work with Core modules as well, but it's not well tested, so please let me know how it goes.
  7. Just a heads up that I have committed a new version with lots of bug fixes (although I expect there are still some more to come). Also, there was a spelling mistake in the class name of the old version (as noted by @tpr above), so you should uninstall the old version and install this new version from scratch. Would like to get an idea of how many people are using this - I'd like to get it working well, but it's already been a substantial effort and want to make sure this is in demand over the Module Settings Import / Export that I released yesterday. Obviously this is way more powerful, but maybe it's more than most people want. Thanks for any feedback. Cheers, Adrian
  8. I believe this requested change: https://github.com/processwire/processwire-requests/issues/25 to PW will fix it so long as the server is 64bit.
  9. I bet the server that is failing has strict error reporting on. The code you are using should return this error: Error: Use of undefined constant pages - assumed 'pages' So it will work with strict error reporting off, but it's not correct code.
  10. Thanks, I forgot about that - went looking in the field settings - I still think perhaps it would be best to be configurable at the field level.
  11. Yeah, I have and yesterday I decided not to because I didn't want to bloat this will all the tools available in Module Toolkit, but now I am second guessing that decision especially given that Module Toolkit is mostly a Process module so if you don't run it, it's not doing anything. I'll think on this a little more - stay tuned
  12. This is really the domain of although that module does still need a little attention. That said, there might also be a place for it in this module - let me think on this a little more.
  13. Unfortunately, that doesn't actually work: https://github.com/ryancramerdesign/ProcessWire/issues/1060 I'd actually like to not only have the ability to have a hidden images field, but also the ability to restrict a CkEditor field to store uploaded images in only designated image fields.
  14. I haven't tested, but maybe this helps: https://github.com/somatonic/ColorPicker/issues/7
  15. Or if you up are for a little bit of a challenge and great learning experience, you could create your own custom fieldtype based off the Event fieldtype: http://modules.processwire.com/modules/fieldtype-events/
  16. Module has been released and now available over here:
  17. Hi everyone, This is the new official thread for the module that was previewed some time ago here: https://processwire.com/talk/topic/14117-module-settings-import-export/ Big thanks to @Robin S for help testing and feature suggestions! http://modules.processwire.com/modules/module-settings-import-export/ https://github.com/adrianbj/ModuleSettingsImportExport Module features Ability to copy and paste settings from one PW install to another Optional automatic backup of module settings on uninstall and ability to restore settings if you reinstall the module Backup current settings at any time Restore backed up settings at any time Import option checks module name and version number and warns if importing settings from a different version As always, let me know if you find any problems or have any suggestions!
  18. PS, if you need hook documentation, you can get Captain Hook offline with Tracy: http://processwire.com/blog/posts/introducing-tracy-debugger/#captain-hook-panel
  19. Not free, but probably the best way: https://processwire.com/api/modules/api-explorer/
  20. It's fully functional. I'll PM it to you to try out. I'd be curious to get your feedback, and then maybe I'll just release it, maybe on its own, or maybe packaged with Module Toolkit, along with core module support to address @tpr's request.
  21. @szabesz - firstly, sorry for renaming that setting on you I just posted a response in that Wishlist thread - I agree that we need this badly - I have added some suggestions for how, and also to include a "Breaking changes" flag in the ProcessWire Upgrades module, which I also think is important.
  22. I would also love to see this - I think it would be great if we could define it in a Github repo changelog.md file and have the automatically imported into the text in the modules directory, and perhaps even displayed in the module info within a PW install. Perhaps it would even be nice to have a way to add a flag about breaking changes that would show up in the ProcessWire Upgrades module so you are warned before upgrading. @ryan - any thoughts on this? I'd be happy to work on it - obviously I could do the PW side of it from the repo, but would need access to the php files for the modules directory to make that side of things work.
  23. @Jozsef - that error should be fixed in the latest version - please let me know if you have any more problems with it. @Ivan Gretsky - latest version adds that new setting - let me know if it works as expected. I also added to/revised the explanatory text for the various access settings in the hopes of makes it easier to understand. Cheers, Adrian
  24. I think Profields Table might be the nicest solution for this - one column each for "quantity", "unit" and "ingredient".
×
×
  • Create New...