Jump to content

ngrmm

Members
  • Posts

    474
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by ngrmm

  1. My next project will be a website where registered members can create profile pages and projects as subpages of their profile page I have researched and tried a few ways and this is my favorite way so far: My page tree would have the following structure - Home -- Profiles --- Profiles 001 ---- Project A ---- Project B --- Profile 002 ---- Project A -- Admin --- Access ---- Users ----- Profile 001 – User registration runs through the LoginRegisterPro module. – during the user-registration another profile-page besides the own PW-user is created in the page-tree via API. – Per AdminRestrictBranch the display in the backend is restricted, so that the module FEEL can be used for editing the profile page and the associated subpages. – I would like to avoid any page tree view and let user edit their profile and project only via FEEL and some buttons on frontend (add new Project, delete project, unpublish profile, …) The PW own user page would only be used for authentication or password reset. Therefore I would create another profile page with fields for text and images. Can this be solved more elegantly? Are there other modules I'm not aware of?
  2. @flydev just for you to know, I asked Ryan about InputfieldFrontendFile His Answer:
  3. @Flashmaster82 I guess the new page is not activated in your non-default language? Check the settings tab for that. There is a checkbox on the right side of the second language name field. I never experienced this when using the page reference field in the backend, only when you create pages via API/Hooks, you have to activate non-default languages. Is the superuser creating pages via the field using the default language?
  4. @kater do you have more than one language installed but not activated? And give it a try and replace the title field with another text field,
  5. I write vanilla css. Well thats a lie ?. I write scss, but only because of lacking css nesting support. I guess in 1-2 years there should be a browser-support over 95%. Nesting is the only scss-feature i use. Everything else is vanilla css. Compiling scss to css is done by ProCache. I'm not a real programmer and have design/art background. Therefore i try to keep my workflow as simple as possible. In my projects I have to develop some „unusual“ layouts and many times the designs change a lot during the development. Therefore over the years the following distribution of files has worked for me pretty well. _reset.scss _fonts.scss (@font-face and sizes as classes) _globals.scss (color-variables, animation-classes and other global classes) _main.scss (for body and main element if needed) _header.scss _footer.scss m_component-name.scss … p_template-name.scss … I don't use components, but my section/article tags have always a unique classname, which correspond with the related php/css/js files. For Example for a image-slider i would have there three files: m_image-slider.php m_image-slider.scss m_image-slider.js .m_image_slider { width: 100%; } Should there be a need to overwrite some styles on a „project“ template, I can do that in a file like p_template_project.scss body.template_project { .m_image_slider { width: 50%; } } And if there is a need to have two different layouts for the image slider on two pages with the same template, I use the page ID. body.id_1234 { .m_image_slider { width: 80%; } } Therefore my body tag has always these two classes: <body class="id_<?= $page->id; ?> template_<?= $page->template; ?>"> That workflow helped me a lot to save time. Most of the the only my section tag has a classname. .m_image_slider { h2 { } figure { img { } } } What I want to say is that css methods have their justification and use. I do not work in teams and as single programmer it is much clearer and flexible to develop my own small method.
  6. Which syntax is need for this? // field names: // field_1 // field_2 // field_3 // … for ($i = 1; $i <= 40; $i++) { if($page->field_{$i} == 'test') { // this does not work // do stuff } }
  7. Is it a field inside a repeater matrix? Sometimes you need to save the repeater field again, after changing the ck-editor-configs.
  8. Not a real fix, but you could activate these two options: Remove empty paragraph texts Remove non-breaking spaces You find them inside the input-tab of your field > Beautify Markup Toggles I had the same issue with imported text from an API. They were using pseudo-elements inside empty headline tags as visual spacers.
  9. @snck had the same problem. And found out, that podigee-player is DSGVO compliant. At least they say it here. Bu I usually use a div wrapper for iframe embeds, so the classes do not get mixed up or replaced. But there is no way if you have to use the script tag.
  10. @poljpocket But even if i manage to give them access to the right pages. Once they are there, they would see the adminbar …
  11. I already asked him an will let you know what he says
  12. @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?
  13. 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.
  14. 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.
  15. Could you describe this method in more detail? Maybe screenshots from the backend?
  16. 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.
  17. 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.
  18. 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?
  19. 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
  20. try dots $products = $pages->find("price_list.price=20");
  21. 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": "" } } }, …
  22. 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; } } } });
  23. 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
  24. @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; });
×
×
  • Create New...