Jump to content

dotnetic

Members
  • Posts

    1,078
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by dotnetic

  1. Thanks, that is excactly what I need. Great ideas from Ivan. I had the same, but he was quicker ?
  2. Hey @adrian, is there an API to turn Mail Interceptor on, before I send emails from one of my modules? I would like to catch emails if I am on my local dev server and forgot to enable the Mail Interceptor in the Tracy Debug bar.
  3. If your module is namespaced on top of your .module file <?php namespace ProcessWire; you can use in your functions $this->log // or $this->pages
  4. This does not really help, as I have no field for the RockGrid because it is created on the fly in my Dashboard module. When I created that file "site/assets/RockGrid/fields/yourfield.php", the code to add the moment.js lib works, but now my grid was empty. My stats.php (thats the name of my InputfieldRockGrid) file looked like this: $this->rg->assets->add($this->config->paths->siteModules . 'FieldtypeRockGrid/lib/moment.min.js'); I think I then have to also copy the code to setup the RockGrid to this file, right? However, I found a much simpler way to add the script, via ProcessWire's own method. So now in my module I have this code, which works: public function __executeRockGrid() { $f = $this->modules->get('InputfieldRockGrid'); $f->name = 'stats'; $f->themeBorder = 'none'; $f->height = 0; $f->pageSize = 50; // set initial pagination to 25 rows $finder = new \ProcessWire\RockFinder('template=stelle', ['title', 'created']); $field = $finder->addField('mitarbeiterId', ['vorname', 'nachname']); $this->config->scripts->add($this->config->urls->siteModules . "FieldtypeRockGrid/lib/moment.min.js"); $f->setData($finder); return $f->render(); } Any complaints doing it this way?
  5. Hey Bernhard, I get an error that moment.js could not be loaded. Then I found a date.md file which says short note: the name of the module in this file is still RockGrid instead of FieldtypeRockGrid. So I tried to do this, but now I get an error `Call to a member function add() on null` What am I doing wrong? Here is my code. I use RockGrid inside of a module: $f = $this->modules->get('InputfieldRockGrid'); $f->rg->assets->add($this->config->paths->siteModules . 'FieldtypeRockGrid/lib/moment.min.js'); $f->name = 'stats'; $f->themeBorder = 'none'; $f->height = 0; $f->pageSize = 50; // set initial pagination to 25 rows $finder = new RockFinder('template=stelle', ['title', 'created']); $field = $finder->addField('mitarbeiterId', ['vorname', 'nachname']); // $sql = $finder->getSQL(); // $finder->sql = "SELECT id, SUM(value) AS revenue, DATE_FORMAT(date, '%Y-%m') AS dategroup FROM ($sql) AS tmp GROUP BY dategroup"; // d($finder->getObjects()); $f->setData($finder); return $f->render();
  6. Hey @bernhard. You should change the link to the repo in your first post to https://gitlab.com/baumrock/FieldtypeRockGrid as the URL has changed. Also, is the information that this module is still an alpha correct?
  7. Hi @bernhard. I try to get the path to the result pages but also want a fast query, so I am using $found_in_product_title = new \ProcessWire\RockFinder("title|subheadline%=$qs, limit=25, has_parent!=2", ['title', 'name', 'path' => function ($page) {return $page->path;}]); $found_in_product_title = $found_in_product_title->getArrays(); but the path is empty. If I use $found_in_product_title = $found_in_product_title->getObjects(); instead, the path is returned. How can I get an array returned which includes the path to the page? Thanks in advance.
  8. Because it is simply amazing, has an improved user experience, is more lightweight, better looking and has nicer features than version 4. Almost everybody will profit. Please consider voting at github for this feature: https://github.com/processwire/processwire-requests/issues/217
  9. @schwarzdesign Try deleting the LazyCron.cache file in dist\site\assets\cache, then it could work again.
  10. No. Thank YOU!
  11. @SubMon @pwired Did you see yet? Take a look at the video. It seems to become a nice page builder for ProcessWire.
  12. I tried to replace the InputfieldCheckbox render function with a hook in my `_init.php`but it did not work. I get the error in the screenshot below. Here is my hook function: $this->addHookAfter('InputfieldCheckbox::render', function ($event) { // outside a class // $page = $event->object; // if ($page->template == 'admin') return; // tell ProcessWire we are replacing the method we've hooked $event->replace = true; $label = ''; $user = wire('user'); if ($user->language) $label = Inputfield::getSetting("checkboxLabel$user->language"); if (!$label) $label = Inputfield::getSetting("checkboxLabel"); if (!$label && $this->checkedValueIsLabel) $label = $this->checkedValue; if (!$label) $label = Inputfield::getSetting('label2'); $this->set('skipLabel', $this->description || $label ? Inputfield::skipLabelFor : Inputfield::skipLabelHeader); if (!$label) $label = $this->label; // TBA: if($this->uncheckedValue) return $this->renderRadio(); $attrs = Inputfield::getAttributes(); $attrs['value'] = $this->checkedValue; $out = "<label><input type='checkbox' " . Inputfield::getAttributesString($attrs) . " />" . "<span class='pw-no-select'>" . $label . "</span></label>"; $event->return = $out; });
  13. @Klenkes To accomplish this, you need to replace line 94 in InputfieldCheckbox.module "<span class='pw-no-select'>" . $this->entityEncode($label) . "</span></label>"; with this: "<span class='pw-no-select'>" . $label . "</span></label>"; but it isn't a good idea to modify core parts. @ryan Is it possible that you remove the entityEncode from InputfieldSelect in the core, so we can use hyperlinks, classes, etc. in the label, or are there any security concerns? What Klenkes describes is a common need here in Germany. The other solution using InputfieldMarkup isn't as good as this solution. However I think one could replace the render function of the InputfieldCheckbox.module with a hook, but it would be nicer to have this feature in the core. What do you think?
  14. Also count me in ? Keep up the great work.
  15. Thanks for removing the branding. I bought a drink for you. Cheers ?
  16. Looks very nice. But the UI when you hover over an item could be a little more in the style of PW (UIkit) It would be good if you could support plugins for the grid builder, so we can use another framework than Bootstrap.
  17. Hi @bernhard I tried to test and reproduce why this isn't working. When you install RockGrid and RockFinder from URL from Gitlab, then the RockGrid is downloaded and installed into a folder named "FieldtypeRockGrid". But RockFinder tries to look for files in a folder named "RockGrid". So Rockfinder tester isn't working and shows the error that I described and @mel47 also described. That's the first problem. You can solve it, if you download the zip file from gitlab, unzip it in your site/modules folder and remove the "-master" from the folder name, so the name of the folder is "RockGrid". The second problem is, that if your processwire installation is not in the root of the virtual host of Apache (for example in a subdirectory), then the URLs for loading RockGrid's assets isn't correct because it tries to load the files from the root and does not take the subdirectory into account. In one example installation I have two separate PW installations under the same virtual host but in different subdirectories (mydomain.localhost/pw1, mydomain.localhost/pw2). That might be the exact same problem that @mel47 has. If you open RockTester then it is trying to load http://mydomain.localhost/site/modules/RockGrid/plugins/cellHoverInfo.css instead of http://mydomain.localhost/pw1/site/modules/RockGrid/plugins/cellHoverInfo.css
  18. @Jules Vau Yes, thats correct. The setting in site/config.php overwrites the one in the wire directory.
  19. Wow, I waited so long for something like this. I think this could push ProcessWire really forward. When do you plan to release? And will it be a paid module or a free one? Thank you for creating this.
  20. The problem was, that I did not rename the downloaded folder from Gitlab from "RockGrid-master" to "RockGrid". After doing this, it works
  21. I installed the module and RockFinder, but when calling "Rock Finder Tester" the SQL query works, but no grid is displayed. There is a JavaScript error in the console which looks like this: (index):205 Uncaught ReferenceError: RockGrid is not defined at initGrid_ProcessRockFinderResult ((index):205) at (index):216
  22. Thank you Bernhard for finally releasing this module. I can not wait to play with it and share improvements, if I have any. I really can think of many use cases where this grid would be mandatory because it offers so much possibilities.
  23. I exactly think the same as Adrian.
  24. Clapped. Also on Medium ? Thanks for your insights and the PageQueryBoss module looks promising. I think I have a use for it in the near future.
  25. I want to create a repeater field via API and add fields to it. I read that there is a property repeaterFields, but when I try to add a field it does not appear in the ProcessWire backend. I put this code into my tracy console: $fields->delete($fields->get('quiz_answers')); $fields->delete($fields->get('quiz_correct_answer')); $repeater = new Field; $repeater->type = wire('modules')->get('FieldtypeRepeater'); $repeater->name = 'quiz_answers'; $repeater->label = 'Answer'; $repeater->repeaterCollapse = 3; $repeater->required = true; $repeater->repeaterAddLabel = 'Neue Antwort hinzufügen'; // $field->parent_id = wire('pages')->get("name=for-field-{$field->id}")->id; // $field->template_id = $template->id; $repeater->save(); $checkbox = new Field; $checkbox->type = $this->modules->get("FieldtypeCheckbox"); $checkbox->name = "quiz_correct_answer"; $checkbox->label ="This is the correct answer"; $checkbox->tags = 'quiz'; $checkbox->save(); //add fields to repeaterFields $repeaterFieldsArray = array(); $repeaterFieldsArray[] = $checkbox->id; $repeater->repeaterFields = $repeaterFieldsArray; $repeater->save(); But when I go and edit the repeater field 'quiz_answers', no field appears at details -> repeater fields. What is the correct way to add one ore more fields to the repeater via API? Maybe @teppo or @adrian could help me out with this, as you both seem to have some experience with repeater fields? Parts of my code are stolen, copied inspired by https://gist.github.com/teppokoivula/8889040 and https://github.com/adrianbj/ProcessAdminActions/blob/master/actions/PageTableToRepeaterMatrix.action.php#L227
×
×
  • Create New...