Jump to content

ngrmm

Members
  • Posts

    421
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by ngrmm

  1. @poljpocket But even if i manage to give them access to the right pages. Once they are there, they would see the adminbar …
  2. @jensweigel thanks for the detailed explanation. In the latest version of RepeaterMatrix you have the option to copy&paste matrixItems across the entire page. Even if the pages has two different templates. You just need the same RepeaterMatrix field. But I can also understand how you create the structure. And with restricting template usage for children there should be no irritation for customers, right?
  3. let's say I would use LoginRegisterPro to be on the secure side. There is still the issue on how to edit existing page image fields, without the giving any edit permissions. @flydev There is a page with an image field with some uploaded images. How can you offer en edit form to delete the uploaded images and add some new images? I know that a loggedin user (via LoginRegisterPro, with no backend page-edit permission) is able to edit his own profile page on the frontend. An image field on the profile page would be editable with the help of InputfieldFrontendFile. But I was not able to figure out on how to extend this editing possibility to other templates. Ryan mentioned in another thread that the modules section on processwire.com works that way. An regarding giving access to pw-backend: my problem here is, that a user with edit permission can view the page-tree, use the backend search field, … I would like to only allow editing those pages, which are related to users and nothing else.
  4. Actually I will use FormBuilder. The form will create pages. And I will use hooks to generate an email after the page is saved and send it to the user (just guests). In the email the user will find two links. One for deleting the created page and one for editing. The edit link will have the guest email and a random alphanumeric string as url segments. This way they will be able to only edit „their“ pages When they click this link, they would see a form which is already populated. This works with text fields or checkboxes. My Problem are image fields. I do not want the user to have any edit roles or some kind of backend access.
  5. Could you describe this method in more detail? Maybe screenshots from the backend?
  6. thanks @Juergen for the quick response! Maybe I'll try this: integrating existing images as multi-checkboxes. And an upload field for the new ones.
  7. Hi @Juergen is there a way to mimic setDefaultValue() for images fields? I would like to use your module for editing existing pages in frontend and it would be great to be able to edit and delete existing images and add new ones.
  8. My idea was to create a form with matching fields as the existing page template and populate those form fields with the values. The form would overwrite the existing page fields values. But this would not work with an existing image field. There is no way of to populate the file-upload-field with the existing images and allowing the user to sort, delete and add new images, right? Is there a way to have guests edit published pages with images?
  9. I'm not sure about text fields in combination with operators. Maybe you try a float field. But in general i would recommend to use a search index field: look here
  10. try dots $products = $pages->find("price_list.price=20");
  11. I tried to import pages from another pw-installation The process results in an error as soon as it starts doing the import. All steps before ok (choosing destination, linking fields, …) working fine. PW creates one page, sets the page name but is not able to set the page title and gives this error: Schwerwiegender Fehler: Uncaught Error: Call to a member function setLanguageValue() on null in wire/modules/LanguageSupport/FieldtypeTextLanguage.module:159 #0 wire/modules/LanguageSupport/FieldtypeTextareaLanguage.module (114): FieldtypeTextLanguage->___importValue(Object(Page), Object(Field), Array, Array) #1 [internal function]: FieldtypeTextareaLanguage->___importValue(Object(Page), Object(Field), Array, Array) #2 wire/core/Wire.php (425): call_user_func_array(Array, Array) #3 wire/core/WireHooks.php (952): Wire->_callMethod('___importValue', Array) #4 wire/core/Wire.php (484): WireHooks->runHooks(Object(FieldtypeTextareaLanguage), 'importValue', Array) #5 wire/core/PagesExportImport.php (957): Wire->__call('importValue', Arr (Zeile 159 in wire/modules/LanguageSupport/FieldtypeTextLanguage.module) Diese Fehlermeldung wurde angezeigt wegen: Sie sind als Superuser angemeldet. Fehler wurde protokolliert. Both sites have the same languages installed (default/de) This is an example of my json: { "type": "ProcessWire:PageArray", "created": "2023-05-18 11:32:25", "version": "3.0.200", "user": "admin", "host": "website.com", "pages": [ { "type": "ProcessWire:Page", "path": "/path/path/some-title/", "class": "ProcessWire\\Page", "template": "team_member", "settings": { "id": 13702, "name": "some-title", "status": 1, "sort": 31, "sortfield": "sort", "created": "28-03-2022 18:39:22", "modified": "28-03-2022 18:46:39", "name_en": null, "status_en": 1 }, "data": { "title": { "default": "Name LÖL", "en": "Name LÖL" }, "headline": { "default": "", "en": "" }, "phone": "0987654321", "email": "email@website.com", "body": { "default": "<p>text</p>", "en": "" } } }, …
  12. this worked $this->addHookBefore('Pages::save', function($event) { $p = $event->arguments("page"); if($p->id == "1599") { $p->of(false); foreach($p->table as $row) { if($row->pass == "") { $pass = new Password(); $string = $pass->randomAlnum(22); $row->pass = $string; } } } });
  13. I would like to run this via a hook: $page->of(false); foreach($page->table as $row) { if($row->pass == "") { $pass = new Password(); $string = $pass->randomAlnum(22); $row->pass = $string; } } $page->save('table'); and tried this: $this->addHookAfter('Pages::save', function($event) { $p = $event->arguments('page'); if($p->id == 1599) return; // my page $p->of(false); foreach($p->table as $row) { if($row->pass == "") { $pass = new Password(); $string = $pass->randomAlnum(22); $row->pass = $string; } } $p->save('table'); }); But I get a 500 error. Is it an infinite loop? SOLVED
  14. @MoritzLost I added it this way. Thanks a lot for the help and the module! Another question that I have: If I wanted to add it manually, where in your snippet do you choose the specific form? Or would it add the hCaptcha to all forms? // site/init.php wire()->addHookAfter('ProcessPageEdit::buildForm', function (HookEvent $event) { $form = $event->return; $submitButton = $form->getChildByName('submit_save'); if ($submitButton) { $hCaptcha = $event->wire('modules')->get('InputfieldHCaptcha'); $hCaptcha->set('label', __('Spam Protection')); // ... configuration goes here $form->insertBefore($hCaptcha, $submitButton); } $event->return = $form; });
  15. @MoritzLost Are you sure you're not logged in, and your guest user doesn't have the permission to bypass the captcha? yes Maybe the form was cached while you viewed it as the admin, and the guest user is seeing the cached output without the captcha input? I guess that is not the case What happens if you submit the form (as the guest user) while the captcha is not visible - do you get an error or does the submission succeed? It gives me this Error: [fieldname] - Captcha response is missing. Please fill out the captcha and try again. Depending on selected strength and hCaptcha subscription (if any), the script may not always show a visible captcha if it's confident you're a real user. Try reloading the page with the DevTools open - is the hCaptcha script being loaded? I was testing it always with devtools open with reset-cache-mode active If so, maybe it's just using a hidden captcha. If not, the inputfield is probably not included at all, then it's probably an issue with your template. Can you post your form builder template? Depending on how your template is built, you might need to include the hCaptcha inputfield manually. Maybe you could try it yourself on a Test-PW-Installation. Just generate a FormBuilder form with simple text fields and a hcaptcha field and try out embed-option D. Generate a copy markup of the form via FormBuilder. PW generates a copy here: /site/assets/cache/FormBuilder/ After copying it to /site/templates/FormBuilder/ the hcaptcha-field won't show up
  16. @MoritzLost having the same problem. Nothing shows up. Using PW 3.0.200 FB 5.3 and latest hCaptcha-Inputfield. I added it to my form as per instructions with secret and site keys from hCaptcha. I tried it in another Browser as a guest-user. Still nothing to see. I'm using the custom markup embed option (D). So when I generate the markup via formbuilder there is no sign of the captcha field in the markup. echo $forms->embed('form_name'); But also if I use the B option echo $forms->render('form_name'); still nothing. Any Idea what I'm doing wrong? UPDATE: It looks like it's not compatible with the option D of embedding forms. As long there a file with same name as the form here: /site/templates/FormBuilder/… the captcha is not there. Is there a way to add it manually?
  17. @Robin S thanks! Okay. The history is empty! my page names are /20years (default – language) /de/20Jahre (de – german second language) When I enter www.domain.com/20jahre the page shows up but in the default language. Is there any cache that I have to empty? Even if I add de:/20jahre in the backend, it does not work as it should. UPDATE: Or is it a problem to have a redirect url-name like the page name of the non default language?
  18. yes it is installed. It is still giving this error Call to a member function getPathHistory() on null maybe it is because it's a backend module and has to be initialized on the frontend before?
  19. I have a redirect problem with a page inside a multi language website and would like to have a look at the page path history of that page. But I get an error if I use this for example: https://processwire.com/api/ref/page-path-history/ $array = $pagePathHistory->getPathInfo($page); // Error: Undefined variable: pagePathHistory on line: 1 Exception: Call to a member function getPathInfo() on null on line: 1 How can I use the page-path-history class.
  20. Good idea, but maybe it's better to have this optional. I explained this so many times to clients but some of them still would like to have something like an explainer popup. But another topic is the obligation to protocol clicks/sessions (GDPR) for sites which have more than necessary cookies. I messaged @joshua a while ago, but he had no time back then. Maybe someone else could come up with a solution? I don't have the skill to do that, but would be happy to sponsor the work.
  21. no thx 🙂 but maybe to @joshua the creator of the module.
  22. "Accept all" means YES to all groups "Accept necessary cookies only" means YES only to necessary cookie (NO to statistics, external …) Try it like in the docs: <script type="text/plain" data-type="text/javascript" data-category="statistics" data-src="/path/to/your/statistic/script.js"></script> Do you work local or on a webserver?
×
×
  • Create New...