Robin S

Members
  • Content count

    2,204
  • Joined

  • Last visited

  • Days Won

    113

Robin S last won the day on January 16

Robin S had the most liked content!

Community Reputation

3,389 Excellent

2 Followers

Profile Information

  • Gender
    Male
  • Location
    New Zealand
  1. Good solution, thanks.
  2. Stoked about the new documentation site! I love it even more with the text size zoomed to 125% In due course it would be great to add a section about barDumpLive() / bdl() - I've never been clear on when it's okay to use this and when it should be avoided due to the dumped variable getting mixed up. I use it from time to time and when there is a variable mix-up it's usually pretty obvious, in which case I switch to bd() with max depth and max length options included. Although I still worry there might be situations where the mix-up is more subtle and could lead to confusion. Related to this: what do you think about adding a new shortcut method for "big" bardumps? This could have options in the module config for max depth and max length. Just so there's a quick way to do a bardump where you need greater nesting depth and string length than with the standard bd(). I have added a custom shortcut in my IDE for inserting a bd() with max depth and length options, but it would be cool to have something like a "bdb()" method in Tracy (until the barDumpLive thing is resolved anyway).
  3. Not sure. It works for me in PW 3.0.88. Seems like it could be a Javascript error - check your browser console to see if that reveals any issues.
  4. Setup > Templates > my-template > Advanced > Label for Children Tab
  5. I can confirm the problem. When the inputfield is inside a repeater item the module tries to open the link modal for the repeater page, but non-superusers do not have direct access to repeater pages. The core link modal (opened from CKEditor) does not have this problem because in the case of being inside a repeater item it opens the link modal for the container page instead. You can apply the same logic to this module by editing InputfieldAssistedURL.module, changing line 62... $btn->attr('data-page-id', $this->page->id); ...to (edit: there could be multiple nested repeaters, so best to borrow the code from ProcessPageEditLink)... $page = $this->page; $n = 0; while(wireInstanceOf($page, 'RepeaterPage') && ++$n < 10) { $page = $page->getForPage(); } $btn->attr('data-page-id', $page->id);
  6. That was my initial thought too, but then I realised that this module by definition applies to situations where there is only zero or one child of that template under a parent. So that selector is at most going to return one page.
  7. This is a setting for Page Reference fields. It appears when you select "Custom format (multiple fields)" in the "Label field" dropdown. You would use something like {default_instrument.title} as part of the custom format, so you can see what the default instrument is for each player within the Page Reference inputfield and therefore if you need to override it. But bear in mind that if you do not manually select an instrument for each player and a player later changes their default instrument then all the concerts they have performed in will show the new default instrument, which wouldn't be good.
  8. This approach works for the backend too. $wire->addHookBefore('InputfieldSelect::render', function (HookEvent $event) { $inputfield = $event->object; $field = $inputfield->hasField; if(!$field || $field->type != 'FieldtypeOptions') return; if($field->required) $inputfield->options = array('' => 'Choose One') + $inputfield->options; });
  9. @adrian, you are right that the issue is with InputfieldSelect. I added a note to that effect at GitHub. Until it is fixed this seems to be an okay workaround: $wire->addHookBefore('InputfieldSelect::render', function (HookEvent $event) { $inputfield = $event->object; $field = $inputfield->hasField; if(!$field || $field->type != 'FieldtypeOptions') return; if($field->required) $inputfield->required = false; }); The inputfield is still treated as required in Page Edit.
  10. Yeah, it's not a solution. There is an open GitHub issue for this: https://github.com/processwire/processwire-issues/issues/349
  11. Glad you have it working. Just a couple of things to be aware of if you do it this way: 1. Depending on how many Walk Variations are within a Walk, and how many Walk Segments are within a Walk Variation, you could end up loading way more pages into memory than you actually need (you only need the Walk pages). But if the number of pages isn't large then this could be fine. 2. If there are a lot of Walks in the continent, and for efficiency you want to paginate them into groups of 20 for example, this becomes difficult. Because you don't know how many Walks will result from any set of Walk Segments until you loop over them.
  12. Sounds very useful. Please share your module fork when you're ready.
  13. Not quite sure what you mean here. You somehow edited the Map Marker fieldtype to include a continent subfield? Or do you just mean you added a field Continent to the Walk Towns template? It might depend a bit on what type of field Continent is, but something like this should work: $walks_in_africa = $pages->find("template=walk, (children.children.start_town.continent=Africa), (children.children.end_town.continent=Africa)");
  14. It looks like a deliberate decision to get the original Pageimage if a variation name is given. See here. So I don't think it's a bug. Perhaps the expectation is that if you want a variation you will always get that from the original Pageimage with one of the resizing methods. For example: $pageimage = $page->filesManager->getFile("/path/to/filebasename.jpg"); $variation = $pageimage->size(400,400); This seems like the way to go because that way the variation is created in the event that it was somehow removed previously. Will this work for you?
  15. You may know this already, but just to explain the reason... Guest users do not have direct access to repeater pages because they live under the Admin branch (guest users can only view repeater content via a repeater field). One solution is to add "check_access=0" to the selector if it is definitely the repeater pages themselves you want to find. Or instead you might want to find the pages that the repeater pages are contained within... $container_pages = $pages->find("Images_With_Variations.title|Images_With_Variations.keywords*=" . $search_term_string);