Robin S

Members
  • Content Count

    2,872
  • Joined

  • Last visited

  • Days Won

    142

Robin S last won the day on November 11

Robin S had the most liked content!

Community Reputation

4,718 Excellent

4 Followers

About Robin S

  • Rank
    Hero Member

Profile Information

  • Gender
    Male
  • Location
    New Zealand

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Robin S

    Yeah, it's not clear exactly which languages are supported but the example in the docs... ...makes me think there is some non-English language support. Good solution. Thanks for adding this feature.
  2. Working fine here: $wire->addHookBefore('InputfieldImage::render', function(HookEvent $event) { /* @var InputfieldImage $inputfield */ $inputfield = $event->object; if($inputfield->hasField == 'image') { $inputfield->setMaxFilesize('2m'); // Set the max file size in bytes or use string like "30m", "2g" "500k" } }); But if you have client-side resizing enabled for the field that will likely interfere with the checking of the filesize before upload.
  3. Robin S

    Nice one. I have another enhancement in mind but perhaps you wouldn't agree with the premise. The default Child Template Suffix is "Items" so I guess you like to name the child templates with the plural, but to me the parent template should be plural and the child template should be singular. And ideally the singular wouldn't be created by appending the word "item" but would be a bit smarter. So if the noun is "car" then the parent template is "Cars" and the child template is "Car". And as a trickier example, if the noun is "bacterium" then the parent template is "Bacteria" and the child template is "Bacterium". An an experiment I added pluralize.js to the module and it's working great, with ProcessPageFieldSelectCreator.js consisting of: $(window).load(function() { $('#Inputfield_fieldLabel').bind('keyup change', function() { var field_label = $('#Inputfield_fieldLabel').val(); var plural = pluralize(field_label); var singular = pluralize(field_label, 1); $('#Inputfield_parentTemplate').val(plural); $('#Inputfield_childTemplate').val(singular); $('#Inputfield_parentPageTitle').val(plural); }); }); Of course the user would want to double-check that the plural/singular forms are what they want, but this addition could save time if you are creating a lot of select fields (which is something I needed to do recently). The pluralize library looks like it handles non-English languages too but I couldn't find documentation on that and I'm not competent to test that myself. What do you think?
  4. Exactly the same as the hook I posted above, but substitute InputfieldImage for InputfieldFile.
  5. I haven't needed to do anything like this before, but I think it might be better to use a separate template for all these extra profile fields. When a user is added you use a hook to automatically create a profile page for the user. Or potentially vice-versa. The user page and the profile page would be connected via a Page Reference field. When it comes to editing the profile pages you may want to let users change their password or email address. This could be done by providing a (modal?) link to ProcessProfile within the Page Edit interface (using Runtime Markup or similar) or you could add password and email address fields to the profile template and then update the equivalent fields in the user page in a saveReady hook.
  6. Robin S

    Thanks for these updates - working perfectly now.
  7. I haven't heard of such an issue before. My only other idea is to make sure $config->debug = true in /site/config.php so that you will see any PHP errors that might be occurring. Or better yet, install Tracy Debugger and enable the debug bar for the backend as this will catch errors even more reliably.
  8. Robin S

    This worked for me: Alternatively this also worked, in /site/modules/InputfieldCKEditor/config.js: CKEDITOR.editorConfig = function( config ) { config.colorButton_colors = 'CF5D4E,454545,FFF,CCC,DDD,CCEAEE,66AB16'; };
  9. These are already excluded from the autocomplete as far as I can tell. // ProcessPageEditLink > Link to URL: exclude pages using templates without template file and unpublished pages $wire->addHookBefore('InputfieldPageAutocomplete(name=link_page_url)::render', function(HookEvent $event) { $inputfield = $event->object; $fileless_templates = []; foreach($this->wire()->templates as $template) { if(!$template->filenameExists()) $fileless_templates[] = $template->id; } $inputfield->findPagesSelector .= ', status!=unpublished, template!=' . implode('|', $fileless_templates); }); // ProcessPageEditLink > Select Page / Select Child Page: prevent selection of pages using templates without template file and unpublished pages $wire->addHookAfter('ProcessPageEditLink::execute', function(HookEvent $event) { $css = '.PageListStatusUnpublished .PageListActionSelect, '; foreach($this->wire()->templates as $template) { if(!$template->filenameExists()) $css .= ".PageListTemplate_{$template->name} .PageListActionSelect, "; } $css = rtrim($css, ', '); $css .= ' { display:none !important; }'; $event->return .= "<style>$css</style>"; });
  10. Robin S

    The current version of the module isn't creating any option pages when using the standard "title only" option for Select Options. The parent page is created but no child pages. Settings: Result:
  11. Robin S

    Hi Adrian, I think it would be good to provide a dedicated field for setting the parent page title rather than setting it the same as the field title. An example: I'm creating a select field to choose a geographical region. Only one region may be selected, so the field title should be "Region". Each individual page represents a region and together they make up the set of regions, so it makes sense to me that the parent of those pages should be titled "Regions" and not "Region".
  12. Robin S

    I can't reproduce that on my secure sites - for me the panel and modal load pages over HTTPS. Normally for an HTTPS-only site you would enable the HTTPS redirection in .htaccess: https://github.com/processwire/processwire/blob/341342dc5b1c58012ae7cb26cffe2c57cd915552/htaccess.txt#L91-L95 So that would be something to check.
  13. My guess is that some non-printable character got pasted inside your code. See the comments in this thread from here down: If that's not it then you can also use Tracy Debugger to debug why $template is undefined for you. All that the relevant code inside the hook is doing is looping over the $templates API variable with $template representing each Template object, so I can't see where else that could be going wrong.
  14. Do you have a large number of inputs on this page? Inputs being images, repeater items, other fields. If so you might be exceeding PHP's max_input_vars setting. https://www.virendrachandak.com/techtalk/big-forms-and-php-max_input_vars/ If you do have a lot of inputs and cannot change max_input_vars then it may help if your repeater items are ajax-loaded as needed and not opened by default.
  15. Robin S

    Minimal Fieldset Adds a config option to Fieldset/FieldsetGroup/FieldsetPage to render the fieldset without label or padding in Page Edit. When a neighbouring field in the same row is taller than the fieldset the extra height is distributed evenly among rows within the fieldset. Requires ProcessWire v3 and AdminThemeUikit. Why? This module allows you to create layouts in Page Edit that would not be possible without it. It's useful when you want a layout that has two or more fields as rows that are themselves within a row in Page Edit. It's also useful when you have some fields that you want to add to a template as a group (i.e. via FieldsetGroup or FieldsetPage) but having a heading and visible wrapper for the fieldset in Page Edit would be redundant. Example: Installation Install the Minimal Fieldset module. Usage In the field settings for any Fieldset/FieldsetGroup/FieldsetPage, tick the "Remove label and padding for this fieldset" checkbox. https://github.com/Toutouwai/MinimalFieldset https://modules.processwire.com/modules/minimal-fieldset/