Jump to content

nabo

Members
  • Posts

    110
  • Joined

  • Last visited

Everything posted by nabo

  1. Hello I have a question: is it possible to set email field as unique value field? It's quite strange to me that this is not a feature... or I missed something? 😕
  2. Hello I really don't know if it's the right place... I have a CKeditor Textarea and the text inside is like this <p><strong>something></strong> <em>other</em></p> When I render the text in template the space between strong and em is removed... 🤔 OK.....it is caused by HTML minify :(((
  3. Hi is it normal that if I add two different roles (that have different restricted branch) to a user, when I log in I can see only one branch?
  4. Hello this is my script public function recordUserModifications() { $this->addHookBefore('Users::saveReady', function($event) { $page = $event->arguments('page'); $page->setTrackChanges(Wire::trackChangesValues); $page->setTrackChanges(true); $new_changes = $page->getChanges(true); die(var_dump($new_changes)); }); } and this is the result, when I change name and email array(2) { ["name"]=> array(1) { [0]=> NULL } ["email"]=> array(1) { [0]=> NULL } } I expect an associative array containing an array of previous values, indexed by property name, oldest to newest, but it's NULL. Thanks if you have some suggestions
  5. Hello I wrote a module with a hook in page render. The problem is that the hook works also when page are "rendered" in lister. Is it possible to isolate the page render only to the single page view? thanks
  6. I'm trying to understand what are the differences between toggle and select options (with radio input of course) 🤔
  7. Hello I have a page that is called "Uno" in default language (italian) and "One" as English version, and parent is "Servizi" ("Services" in English). I need to get this page using path... so $pages->find('path=/it/servizi/uno') but I think this is equivalent to $pages->find("path=/servizi/uno") the problem is that I want to get this page using the solely the language path because this case always return the page... and it's not what I want $pages->find("path=/it/services/uno") $pages->find("path=/it/servizi/one") $pages->find("path=/en/servizi/one") $pages->find("path=/en/services/uno") is there a way?
  8. Yes... but these settings make sense if they are at field/template level, not page.
  9. Hello I'm working on a project that use PW as backend CMS. PW serves formatted data of each page but the engine simply generates json from pagearray. I would like to set one or more variations on images, so I think it would be useful if there were a field to set possible variations... even with overrides!
  10. nabo

    Find users

    I've tried... but I don't get any results... this is the selector in use: has_parent!=2, _custom="template=user", limit=25, sort=-modified, include=unpublished I also would like to display ProcessPageLister in a custom module $pl = $this->modules->get("ProcessPageLister"); $pl->defaultSelector = "template=3, parent=29, include=all, limit=100, status<9999999, sort=name"; $out = $pl->execute(); return $out; but... this is the result
  11. Hello I use Form Builder to create PW page from form. But I would like to block page creation if there are some conditions. I think I have to hook SaveReady... but how can i prevent page creation? thanks
  12. Sorry... it was a Croppable Image field. I switch to ImageField and now it works!
  13. Hello I recently switch a Processwire site from 2.8 to last version (3.0.126). I had some little things to fix but it has been easy. But now I notice a problem on ImageField. I attached a screenshot I can't see image... but there's
  14. Hello is there a way to find users using Page Lister? I know that I can use Access Lister under Users... but what I really need is the bookmark feature that unfortunately is not presente here.
  15. Thanks... I see. But I can't understand why this warning
  16. Hello I attached a screenshot of the problem I see in any user edit page
  17. Hi when I upload a file via custom file the name is changed. I think that there's a core sanitizer... eliminates spaces, double spaces and replace any strange character with _ What's the rule behind?
  18. Hello I can't get the title in other language than default $type_materials = $fields->get('material_tipology'); foreach ($type_materials->type->getOptions($type_materials) as $type_material) { echo $type_material->title; } this works but I get only default title in every language.
  19. SOLVED case 'FieldtypeFieldsetPage': $rdata = []; $rdata["label"] = $field->$label ? $field->$label : $field->label; foreach ($field->repeaterFields as $i) { $l = wire('fields')->get($i)->$label ? wire('fields')->get($i)->$label : wire('fields')->get($i)->label; $rdata[$l] = $p->$field->get($i); } $pdata[$field->name] = $rdata; break;
  20. Thanks... but, again, this is not problem since I get ALL fields with this foreach foreach ($field->fields as $f) { instead of fields related to fieldsetPage
  21. Thank @elabx but the problem is not there. It's here case 'FieldtypeFieldsetPage': $rdata = []; foreach ($field->fields as $f) { $rdata[$f->name] = $f->get($f->name); } $pdata[$field->name] = $rdata; break;
  22. Hello, this is my code $p = $pages->get("/".$pageId."/"); if($p->id) { $pdata = ["id" => $pageId]; // array for storing page data with added page id $p->of(true); // set output formatting to false before retrieving page data // loop through the page fields and add their names and values to $pdata array foreach($p->template->fieldgroup as $field) { if($field->type instanceof FieldtypeFieldsetOpen) continue; $value = $p->get($field->name); switch ($field->type) { case 'FieldtypeOptions': $pdata[$field->name] = $p->get($field->name)->title; break; case 'FieldtypeFieldsetPage': $rdata = []; foreach ($field->fields as $f) { $rdata[$f->name] = $f->get($f->name); } $pdata[$field->name] = $rdata; break; default: $pdata[$field->name] = $field->type->sleepValue($p, $field, $value); break; } } $response = $pdata; I'm trying to get all fields and values from a FieldtypeFieldsetPage (I think that for a repeater is the same)... but it doesn't work... I got ALL fields with null value
  23. Hi Bernhard and thanks for your attention. I used your tip in a bad way... now it works
×
×
  • Create New...