Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by adrian

  1. @bernhard - I've been using the feature built into AOS for this. You can see the code for it here: https://github.com/rolandtoth/AdminOnSteroids/blob/2e8f9c56dbc0d05edcb203d7dcf9af31eb862b02/AdminOnSteroids.module#L780-L796
  2. https://processwire.com/docs/front-end/markup-pager-nav/
  3. @michelangelo - the non-pro version of the Lister doesn't support inline editing. If you don't want to buy ListerPro, then you could perhaps modify the normal BCE edit mode to support custom fields (that wouldn't be too hard actually). The more complicated part would be building in the pagination, which BCE doesn't currently have, although it really does need it, especially with your setup with 3346 child pages. I don't really have time to work on adding those things any time soon, but they would make great additions if someone wants to contribute via a PR.
  4. I moved a couple of production servers to 8 about 2 weeks ago. Everything looks good so far. The only bug I found was in my own code related to 0 vs ''
  5. Bit me once again today :) In this case I did have that module installed, but even after disabling it, I still had issues with a particular template where I had specifically set noLang in the advanced template settings, so watch out for that.
  6. I added this to my search.php template file. Hope that helps. $searchEngine->addHookAfter('Renderer::renderResult', function($event) { $p = $event->arguments[0]; $image = $p->getunFormatted('pdf_images|image|images|video_images')->first(); if($image) { $thumb = $image->size(0, 260, array('upscaling' => false)); $event->return = ' <div class="row"> <div class="small-12 medium-4 large-5 xlarge-4 xxlarge-3 columns teaser__image"> <a href="'.$p->url.'"> <img style="max-height: 300px" src = "'.$thumb->url.'" /> </a> </div> <div class="small-12 medium-8 large-7 xlarge-8 xxlarge-9 columns teaser__content"> ' . $event->return . ' </div>'; } });
  7. Sorry about that - looks like I messed up the property name. I just tested though with "roles" and it's working here, eg: $options = array( "page_protected" => true, "children_protected" => true, "roles" => array("editor"), "message_override" => "My custom login message", "prohibited_message" => "My custom prohibited access message" ); $page->protect($options); I'll fix the documentation in a minute, but you you please try the above to confirm it's working for you.
  8. @Macrura - thanks to @Robin S in another post: https://processwire.com/talk/topic/15902-hannacodedialog/?do=findComment&comment=208498 // add hanna code dialog to fields even though the Hanna code text formatter isn't applied // https://processwire.com/talk/topic/15902-hannacodedialog/?do=findComment&comment=208498 $this->wire()->addHookAfter('InputfieldCKEditor::renderReadyHook', function (HookEvent $event) { $inputfield = $event->object; $field = $inputfield->hasField; // For your field name(s)... if(!$field || $field->name !== 'XXXX') return; $config_name = "InputfieldCKEditor_{$field->name}"; $config_name_matrix = "InputfieldCKEditor_{$field->name}_matrix"; $config = $this->wire('config'); $js_config = $config->js(); foreach($js_config as $key => $value) { if($key === $config_name || strpos($key, $config_name_matrix) === 0) { $js_config[$key]['extraPlugins'] .= ',hannadropdown,hannadialog'; $config->js($key, $js_config[$key]); } } });
  9. Ah sorry, the way I read things, I thought he had already fixed the separator issue and still didn't like the column widths.
  10. CSVs don't have widths. You are using Excel to view a CSV. If you want a properly formatted Excel file, it's pretty trivial to write an API script to export a series of pages to an Excel file with something like https://github.com/PHPOffice/PhpSpreadsheet which lets you format the spreadsheet almost however you want.
  11. @pwfans - I wonder, do you have a copy of ListerPro? This might be a better option for your needs. It's inline editing isn't quite as convenient as BCE's, but it has pagination and searching and so it scales infinitely.
  12. But how nice would that interface actually be for hundreds / thousands of pages? What sort of bulk edit actions are you referring to? Changing status, or deleting etc? I suppose there could be a way to select all across all pages if they were to be paginated. I'm afraid I just don't see it as the right tool for the job in this case, but if you want to add support for this, I'm happy to accept a PR.
  13. @donatas - the only viable approach is to use teppo's add-on module: https://processwire.com/modules/admin-restrict-branch-select/ Any other approach would be a complete rewrite and would have other complications.
  14. @pwfans - I always disable BCE for pages that have too many children for the edit mode to handle. I don't really think the edit mode makes much sense with that many pages anyway so I don't think pagination will help. If you need to batch edit that many child pages you probably need to write a script via the API (Tracy Console panel or AdminActions perhaps?) to make the changes.
  15. There is also https://processwire.com/store/pro-dev-tools/user-activity/ so given that, I don't see anything like it ending up in the core.
  16. @ryan - what about a dedicated "Skins" section - maybe within the modules directory. Perhaps the requirement for adding a skin to the directory would be to link to a Github repo with the admin.less and also an admin.png file which could be used on the skin's page in the directory. Ideally I think it would be nice if it was possible to view all skin screenshots via a gallery of thumbnails to make it easy to browse visually.
  17. @Tom - I think the field=title within the quotes selector, vs having the list of fields in a separate quoted group is optional either way. The "array_values" is needed because the text tags needs the array to be indexed numerically starting at zero, rather than the page IDs which findRaw() returns.
  18. @Pete - I'd like to second this - is it an easy fix to show the full message in the email? Thanks!
  19. @fruid - I'll admit the database vs in-memory can be somewhat confusing in PW in terms of what selectors are support for one but not the other. This definitely needs improvement and better documentation, but I don't think that is really relevant in this case. Once you assign an array of pages to a variable and then do a find on that, you are using an in-memory selector - you're not querying the database anymore. This means if you are loading so many results that you need to paginate, then you're losing some of the benefits of pagination. This is not PW specific or even PHP specific. Regarding the two subsections - are you grouping results into these subsections? It's hard for me to advise on that without having an example of exactly what you are trying to do.
  20. I can confirm that @matjazp's example works. The thing is though that this still means that you are loading all pages into memory and then paginating. This doesn't seem like a good idea in general - is there a reason you can't limit the find() to the results you want and just use my example which only loads the required pages for each page/view - much more efficient and scalable. What is the actual set of pages you are trying to query? Have you tried to build a selector that can get what you want with one find operation?
  21. Thank you @bernhard and @ryan This is really brilliant and exactly the type of skinning ability that I think we've been missing!
  22. Can you try this bare-bones example: $pager = $modules->get('MarkupPagerNav'); $items = $pages->find("id>0, limit=10"); // replace id>0 with your selector echo "<ul>" . $items->each("<li>{title}</li>") . "</ul>"; echo $pager->render($items); // render the pagination navigation This works perfectly for me - each page has 10 results and each page starts where the last one stopped. If that doesn't work, and you have pagination enabled for the template where you add this code, then I have no idea :)
  23. Do you need to specify the start? As you can see here: https://processwire.com/api/ref/markup-pager-nav/ everything is automatically handled when you load MarkupPagerNav and use its render() method. No need to specify the start. Does that not work for you?
  24. My apologies @fruid - I read this thread quickly and saw you comment about a custom paginated array and assumed that meant you were building up an array of pages rather than letting the pagination API handle querying the DB automatically. Sorry, I was in a rush and didn't fully grasp things. Good luck getting things sorted. I don't have time to dive deeper into this, but I guess I don't understand why you need to use the setStart() etc methods. I just build my selector and add a "limit=x" to it and that's it - everything else is automatic, but obviously I am not understanding your needs properly.
  • Create New...