Jump to content

Kiwi Chris

Members
  • Posts

    289
  • Joined

  • Last visited

  • Days Won

    4

Kiwi Chris last won the day on April 11 2022

Kiwi Chris had the most liked content!

Profile Information

  • Location
    New Zealand

Recent Profile Visitors

4,236 profile views

Kiwi Chris's Achievements

Sr. Member

Sr. Member (5/6)

448

Reputation

  1. With regard to the documentation, it would be quite good to have newer features that have been mentioned in this weekly update or blog posts incorporated in the main documentation. Possibly also some of the pro modules stuff, as at the moment documentation is scattered around either in the forum or on the shop pages to purchase the pro modules. While it makes sense for discussion to be in the forum for people with up to date subscriptions, having documentation in one place might be a help, and might even convince people to buy pro modules if documentation for how they can use them is available. I notice with Lister Pro, there is some documentation in the API reference under Lister with core lister methods and properties and Lister Pro methods listed together but pro methods and properties identified.
  2. Further to what @wbmnfktr said, I think ProcessWire can be described as a low code data designer. You still need a front end developer to build public facing pages, but potentially someone with no backend development skills can build a complex range of templates for different data. In more complex scenarios, yes, it might be necessary to write some modules or hooks, but a huge amount can be done without writing a single line of code, but later, if people want to package up and subject to source control, there are third party modules like RockMigrations that allow taking all the field and template definitions and storing them as migrations files. In a sense, ProcessWire in this respect is like a headless CMS of which there are a few out there that allow custom data design without coding. But wait there's more. ProcessWire can be used as a no code/low code headless CMS, but it also assumes that you'll want to output the data somehow, and give you all the tools to do it, without being opinionated. If you just want to output fields directly into HTML template files with some simple PHP codes, fine, you can do it. If you want to output as API calls and use a javascript frontend framework, you can do it. (Not a core feature, but there is a third party module to enable it) If you want to use a templating language, you can do it. (also via third party modules, or use your own)
  3. Sounds like a new module coming. RockEstimator. 😁
  4. What options are there to autosave individual page fields both in normal pages and repeaters? I see there's a page Auto Save in pro dev tools, but I'm not sure if this is what I need? There's also a commercial module by Kongondo - dynamic selects, but that requires creating a new field of type dynamic select, rather than existing fields, and I'm not sure whether it allows autocomplete rather than dropdowns, so it's not ideal. Mainly my use case is to handle dependent page fields, where one page field depends on the value of another one. I'm aware of the ability to create selectors that refer to other fields on a page, but this doesn't work as required in all scenarios. I know the API allows saving individual fields and can do so silently if necessary. Having the ability to specify individual page fields that should autosave via ajax when they're updated would be extremely helpful. Where this would be particularly useful would be with page Autocomplete input fields, as I've worked out how to hook input to pass the calling page to the hook, for custom selectors, but this only works with current values already saved to the page, so being able to combine this with the ability to autosave specified page fields would help with complex dependencies. For some fields this functionality might be unnecessary or undesirable, so being able to configure it on a per field with per template override as with other field properties would be ideal. Has anyone implemented anything like this, or does the pro page Autosave module do this?
  5. As someone who writes about as much C# as PHP, ? to indicate nullable parameters is familiar, although if they'd put the ? after the parameter type, it would have meant not having to remember a different position depending on language. At least we don't have to put another upside down question mark at the end of the parameter, for probably the majority of us who don't have Spanish keyboards. 🙂
  6. Thanks, that seemed to be the issue. I had included other criteria that I overrode in the hook. For the record, this seemed to do the trick: id!=page.id, template=stockItem One of the annoyances with findReady is it doesn't give you the page that called it, but including id!=page.id is pretty broad and covers anything other than the calling page, which isn't usually going to reference itself. With this selector, I can pretty much do everything I could otherwise with getSelectablePages, so I can filter on any page criteria without needing to include them in the selector string. I was trying to have some parameters both in the selector string and override them.
  7. Not sure whether it's a bug, an inherent limitation of hooking findReady, or that I need to hook some other code as well, but I've found that while hooking findReady can allow me to modify the list of selectable pages for page Autocomplete inputfield for page fields without problem, on save, the data is not saved, and editing the page or reloading always comes up with blank data. This is a scenario where I've provided a selector string in the input tab of the admin UI to configure the field, and then use the findReady hook to read data from this string and modify it to return the correct page list. Not sure if anyone else has experienced this, or come up with a solution?
  8. Welcome to the 50s. And nice to know that @Robin S is so prolific. I sometimes get asked by clients what happens if I have a collision with a proverbial bus, and it's a really good selling point to be able to say there's another Kiwi (what we New Zealanders call ourselves after our national bird - not a fruit) who's a major contributor to the system I use for most of my sites, and who's also developed some quite high profile national sites with it. I suppose I should get a move on and write some modules, but I guess it's testimony to the ProcessWire ecosystem that I haven't needed to as yet (well I have, but they're for specific client business processes, so not something I can release publicly.) Speaking of broadening horizons and geography, even though Robin is on the same island as me, we're at opposite ends, and he's at least a 12 hour drive away. I know I shocked my mother-in-law when she came here, because her idea of an island was that there'd be sea all around, and I took her on a trip that involved very full days with 3 or 4 days without ever seeing the coast.
  9. Thanks for this. It probably shouldn't be too hard to adapt Ryan's InputfiledFormBuilderRecaptcha to use Cloudflare as well. I just read an article today stating that bots can now defeat pretty much all of those visual captchas that ask to identify what squares contain a given object, so this is quite timely.
  10. I've been having a bit of a struggle converting a page reference field from Select to Autocomplete, as with Select, it's possible to hook getSelectablePages, and the actual page the inputfield is on is available to the hook, but with autocomplete, you have to hook findReady, and the page the field is on is not passed to the hook, only the name of the field, which then looks up the selector string from the field definition. None of the hook arguments include the calling page, however $event->argument(0) gives the selector string, and in the field definition it is possible to include some page fields in the selector string in the field definition. eg: The problem is, typically these will affect the pages returned, but I realised that if I added at the START of the selector string in the field definition id!=page.id that will have no influence on the pages returned, as I'm not likely to want a circular reference with a page referring to itself in a page reference field, but this will provide the actual calling page id that requested the page autocomplete. Since the selector string is just a comma delimited list, it's easy enough to convert this to an array, and if I have id!=page.id as the FIRST selector parameter it's easy to get it like so: $selector = $event->arguments(0); $selectors = explode(',', $selector); $pageSelector = explode('=', $selectors[0]); $page = wire('pages')->get($pageSelector[1]); Now that I have the actual page that the autocomplete is on, I can do things beyond what is possible with the selector string in the field definition. In my case I wanted to do this: $owner = $page->parent('template=client'); //Get ancestor page with given template and retrieve a field value from it to use in selector I can then rewrite the selector string as desired. I suppose in theory it would be possible to not use the selector string in the field definition as a selector string at all, but rather as a way of passing parameters to the hook, and then just build your own selector string in the hook. I hope this helps others who've struggled with figuring out where ProcessPageSearch::findReady is being called from. It won't necessarily work for all situations but should work when called from page autocomplete. Edit: I discovered that ProcessWire adds other selectors after the last selector in the selector string in the field definition, so it's really important that id!=page.id is the FIRST parameter in the selector string in the field defintion, unless you like searching arrays. If you make it first, you just need to explode the search string, get the first array element, explode that again, and you've got the page id.
  11. What I'm trying to do is restrict a list for a page reference to pages with template of moveStockItem, that are pulled in from an external API, so I don't have control over the fields in that template, as they just replicate what's in the external API. In that template productVintage is a numeric field, but that's fine, as no one ever edits it manually. That's why I need to use a selector that matches productVintage = item.vintage.title, because in the repeater, users do need to select a vintage, and providing a page reference field helps restrict them to a sensible range. Hooking ProcessPageSearch::findReady seems like an option, but it does seem to be quite messy. With a select list it's easy to hook InputfieldPage::getSelectablePages and that works ok, but switching to autocomplete for the page reference field makes things harder. with autocomplete, I've found using a selector string rather than a hook works fine if the dependency and the dependent fields are on a normal page rather than a repeater, however if both the dependent field and its dependency are in the repeater, that's where things get messy. In the example I'm trying to get working, this part: clientCode%=page.createdUser.clientCode does work, so I seem to be able to reference a field from the page with the repeater field in it ok. I double checked by adding an additional section to the selector to check that page.id refers to the id of the page the repeater field is on, and not the repeater itself, and it does refer to the parent page, not the repeater. I've done some further checking, and although in the thread I linked to previously Ryan says that item should refer to fields in the repeater, in this case it is returning the page the repeater is on. I'm not sure if this is a bug, or an inherent limitation of using find for the autocomplete option?
  12. I've found this thread: Apparently I need to use item. rather than page. to refer to a field within the repeater field. Looks like the inline documentation needs some improvement. Still haven't got it working, but think I'm heading in the right direction. The problem I'm getting is in Tracey Debugger, I can see that the selector query is not getting any value for either page.vintage.title or item.vintage.title, it's just blank.
  13. Does this work with autocomplete? The examples look like they're using a standard select list. I can already do this via a hook in ready.php, but I've specifically been asked to provide autocomplete rather than select lists, and the code that works for select lists does not work with InputfieldPageAutocomplete.
  14. I'm trying to get a page reference field inside a repeater working with autocomplete with dependencies on other repeater fields. I'm using the Selector String option to configure page autocomplete. Currently I have: template=moveStockItem, productVintage=page.vintage.title, sort=page.vintage.title, clientCode%=page.createdUser.clientCode page.vintage.title returns nothing, as it's a field on the repeater, not a field on the page the repeater is in.
  15. I have a scenario where I have a need to store text in a field that may be reused subsequently, but sometimes may be just a one off. I could use a page reference field with InputfieldPageAutocomplete, configured to allow adding new items on the fly, but there are likely to be times that the text input will never be used again for another record. I guess I'd call it InputfieldTextAutocomplete, and it would work pretty much like InputfieldPageAutocomplete, however rather than storing a page reference, it would store text from a specified field in the lookup page OR input custom text to the text field. Has anyone already made a module with this functionality? I've had a browse through the module directory, and can't see anything, but I'm guessing it's functionality that might be quite handy. A specific usage scenario: Record visitor names to a site. Some people may only ever visit a site once. Others are regular visitors and need to complete a form each time they visit. To save time, regular visitors should be able to start typing their details and have the system autocomplete, but for one off cases, someone shouldn't need to create a related record. I can also see a version of this being useful for Form Builder, where people can start typing and pick a list option, or type something not already in the list. @ryan any thoughts?
×
×
  • Create New...