Jump to content

elabx

Members
  • Posts

    1,479
  • Joined

  • Last visited

  • Days Won

    21

Everything posted by elabx

  1. Both are possible: https://processwire.com/blog/posts/field-permissions-overrides-and-more-2.6.2/ Sorry to not bring more info right now, don't really know how to set it through the API, but surely there is a way.
  2. Can confirm Migrations works wonderful and the CLI too, I commonly migrate changes to 30+ sites that share the same functionality, using git + migrations CLI.
  3. Can you get FTP access to the server?
  4. I think that button is added through javascript so you might as well just add it in a script that runs in the admin, like this: http://soma.urlich.ch/posts/custom-js-in-processwire-admin/
  5. Apparently from what I find in the searches, it's just not going to work with text fields:
  6. I did fix the issue but I did needed to modify apache configurations, but it is hard to tell if this is the case in your scenario and I'm guessing not being able to use ini_set() is not making things easier. I could only think of testing in another environment to see if you can reproduce and log.
  7. Ohh! And just read it's a custom field! I was assuming a date field and I do wonder, why not use the default date field for this? I think the selector might not be working because it's not getting saved as a timestamp.
  8. Doesn't using the "=" operator work? Why use "~="? Maybe I'm not catching something.
  9. You are getting into a looping issue because you are hooking into every page saved. I also think you have to hook into Pages which then has the need info in its arguments. wire()->addHookAfter('Pages::saved', function($event) { $page = $event->arguments(0); if($page->template == "user"){ $savedUser = $page; $userpage = wire('pages')->find("parent=Abos, name=".$savedUser->name); if ( count($userpage) == 0 ) { $page = new Page(); $page->template = 'Abos'; $page->parent = wire('pages')->get('/Abos'); $page->title = $savedUser->name; $page->save(); } } });
  10. The times this has happened to me and no errors were obvious, it was mod_security from Apache messing up with the POSTs from edit page.
  11. For example, I have a Galleries repeater field (or repeater matrix), named galleries and I want to render galleries within a text field. Each repeater has an images and title field. Let's say you fill one repeater item's title field with "Party gallery". Then, I have a hannah code that has a title attribute available and is used in the text fields like the following: [[gallery title="Party gallery"]] Then, in the hannah code's code (?), I do a selection like this one: $gallery = $pages->get("galleries.title=$title"); That way the $gallery variable will hold the gallery referenced by the title, which can be picked from setting the hannah code attribute making it very flexible cause then you can have all sort of settings and just pick whatever gallery you want. The pain point for the users is usually going to find out galleries titles, but most users have found it to be quite flexible. Maybe a custom CKEditor toolbar dropdown would complement this approach even better, filling it with gallery names available. Check this awesome module from @Robin S .
  12. I have sometimes used a combination of repeater matrix with a "identifier field" that is later used as an attribute in a hannah code.
  13. Something I've done that is quite useful is setup a Less parsing library like this one that accepts variables and then I pass the variables on to the rendering pipeline, this keeps my styles files clean from php code: Pardon the dirty code: <?php $variables = array( 'main-color' => $home->main_color , 'body-background' => $home->color_main_background, 'icon-colors' => $home->color_icons, 'menu-icon-color' => $home->color_menu, 'footer-gradient' => $home->color_footer_gradient, 'go-top-gradient' => $home->color_got_top_gradient, 'slide-background-color'=> $home->color_slides_background, 'slide-hover-background-color'=> $home->color_slides_hover_background, 'h2-titles-color'=> $home->color_h2, 'headings-font'=> $home->headings_font, 'footer-background' => $home->color_footer_background ); //Set up main file path and directory of imports. $less_files = array( $mainCssFile => $config->paths->templates . 'css/' ); $options = array( 'cache_dir' => $config->paths->assets . 'cache/less/', 'output' => $config->paths->templates. 'css/build.css', 'relativeUrls' => false, "strictMath" => "on"); try{ $css_file_name = Less_Cache::Get( $less_files, $options, $variables); }catch(Exception $e){ $log->save("less", $e); } ?>
  14. As for making the field required, from what I can tell from the source code you need to set the field in the user template as required so it is also required in the registration form. (but I also see that it checks if the field is InputfieldText) I guess you could also make an after hook in the buildForm method, and traverse the form to set the field you want as required, try placing this in site/ready.php and let me know if it worked: $this->addHookAfter('LoginRegister::buildRegisterForm', function($event) { $form = $event->return; $field = $form->get('the_unique_text_field_name'); $field->attr('required','required'); $event->return = $form; });
  15. Maybe this one??
  16. Maybe using the Fieldtype selector in the module autoload setting?? Though I guess that limits the compatibility minimum version. type=FieldtypeInteger|FiledtypeDecimal
  17. Thanks for the heads up!I haven't tried locally but will soon.
  18. No issues for the moment, except can't get autocompletion to work :D. And yes @bernhard, it is a ProcessWire website with the wire folder and all but I'm guessing it might be the context in which i'm editing (SSH FS) and I'm actually loading as root a public_html with a lot of websites underneath it.
  19. Hi! Is there any configuration to get Intelephense autocompletion to work?? Or does it just need to bee installed and that's it?? Sorry, tried to figure out from the thread but just couldn't ?
  20. This is the sole reason also I'm stuck in prehistoric emacs setup, to easily work on servers, always a command away from connecting to a server and opening a folder. OMG it's finally here!! Gonna try this ASAP. https://marketplace.visualstudio.com/items?itemName=Kelvin.vscode-sshfs#review-details EDIT: OMG it works wonders, love this.
  21. In my experience YouTube always feels a bit clunky in comparison to hml5 video with feels more instantaneos, but could be made to work (I've only got it to be responsive with some js though), I agree the most "slick" solution is to use native html5 video and a CDN. I have personally used AmazonS3/Cloudfront for this.
  22. I've gone this way! And used the Google Anaytics API to retrieve the data if needed.
  23. Hi! Has anyone found a solutions for this? I have several sites that use the same composer modules i'd love if I could just install them globally for the user. Though suspecting from where the require_once happens, I feel my only choice would be using symlinks? Just made a comment also in the GitHub issue.
  24. $termine->filter("date>=today")->sort("date")->slice(0,10) I wonder also if this could also work, I could bet it does: $termine->filter("date>=today, sort=date, limit=10"); Keep in mind filter method is destructive.
  25. Would it work if you setup the properties beforehand? And maybe define a catalogue somewhere else with a page field (I do it in a parent page). So you have a text field and not a select field and one line per property. And set them up in a hook (I've done this in Pages::added if I remember correctly) Although this would requiere all fields to always appear on the page, and exclude them from rendering if their description field is not filled. I have also removed the add new button for this purpose through a hook in the inputfield render.
×
×
  • Create New...