Jump to content

Robin S

Members
  • Posts

    4,435
  • Joined

  • Last visited

  • Days Won

    272

Robin S last won the day on September 29

Robin S had the most liked content!

Profile Information

  • Gender
    Male
  • Location
    New Zealand

Recent Profile Visitors

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

Robin S's Achievements

Hero Member

Hero Member (6/6)

8.4k

Reputation

17

Community Answers

  1. I presume you're using MarkupPagerNav. If so see the arrayToCSV option in the docs: https://processwire.com/api/ref/markup-pager-nav/#pwapi-methods-other-options But rather than change this option consider using the whitelist to store the sanitized search input and to set the values/states in your search form instead of using $_GET. See Ryan's Skyscrapers code for examples of how to do this: https://github.com/ryancramerdesign/skyscrapers2/blob/master/search.php https://github.com/ryancramerdesign/skyscrapers2/blob/master/includes/search-form.php
  2. This isn't anything specific to this module - it's just the effect of output formatting being on or off. Unfortunately there is no general documentation page explaining the idea of output formatting but the $page->of() docs gives you some info. The rule of thumb is that output formatting is on in the frontend and off in the backend, particularly in a situation where field values are going to be saved like in the page editor. You can set the formatted value of a single image field to be a Pageimage but when output formatting is on it will always be a Pageimages array. So in FieldtypeRuntimeOnly you need to specifically ask for the formatted value of the field: $image = $page->getFormatted('squareimg'); if($image) { // ... }
  3. For so many items an autocomplete would perform much better. Is that an option? If it's the need to use a hook to specify selectable pages that's preventing you from using PageAutocomplete there are workarounds for this.
  4. @szabesz, the output can't go below the button because the button is not in the results area. But I added a bottom margin so there is some separation from the button.
  5. This might be a somewhat niche module but I had a need for it and maybe others will also find it a useful development helper. Lister To Clipboard Easily copy a selector for the current Lister filters or selected results to the clipboard. For superusers only. Why? Lister or Lister Pro is handy for finding pages according to certain page attributes or field values and you can see the matched pages in a results list. Sometimes I want to run code on some or all the Lister results. Lister Pro allows results to be processed through Page Action modules but there are a couple of downsides to this: To execute custom code you would have to create a custom Page Action module and this may not be worth the trouble for a one-off operation. If you want to process only selected individual pages you can only select items from one page of the results. If you navigate to a different page within the paginated results the selection is lost. Lister To Clipboard gives you an easy way to copy a selector for the current Lister filters or a selection within the results so you can paste it into the Tracy Debugger Console or use it elsewhere in your code. Usage In Lister (Find) or in a Lister Pro instance, create filters to match the pages you want to target. If you want to select individual pages within the results, click an empty area of the cell within the first column (i.e. don't click directly on the page title). The cell will get a green background to indicate that it is selected. If there is more than one page of results you can move around the pagination to select more pages. Below the Lister results there is a blue box showing a selector string that will find the pages shown in your Lister results (or your selection within those results) when used in $pages->find(). Click the copy icon to copy the selector to the clipboard, then you can paste it into the Tracy Debugger Console or wherever you want to use it. https://github.com/Toutouwai/ListerToClipboard https://processwire.com/modules/lister-to-clipboard/
  6. @nicolant, ProcessWire doesn't allow filenames to include dots, perhaps because Images fields use a dot to separate the variation suffix from the basename and Images and Files fields share some of the same code. If using dots in the filename is essential for some reason and you are willing to use an experimental module you could try this: https://github.com/Toutouwai/FieldtypeFileUnrenamed
  7. If by "featured" you mean "linked to within a CKEditor field" then it's pretty easy. You just upload the file to the first page it will be used on (Page A), and on any of the other pages you use the CKE link dialog to select Page A and then select the file.
  8. Check out the blog post that introduced InputfieldTextTags: https://processwire.com/blog/posts/pw-3.0.177/#using-with-options-fields If you use a Page Reference field for your tags then you can add new tags via the inputfield if the field settings are configured to allow it. From the blog post:
  9. One more possibility: get your non-user pages by path instead of by ID. If you use PagesLoader::getByPath() it should be just as robust as getting by ID because page path history will handle any renaming or moving of pages. And as a bonus the code is more readable because it's more obvious what page is retrieved by '/about-us/sustainability/' than by 24875. $p = $pages->loader()->getByPath('/about-us/sustainability/', ['useHistory' => true]));
  10. I haven't been a regular user of the RuntimeMarkup module so I'm not qualified to talk about it. Maybe the best thing would be for you to try both modules and see which one suits you better.
  11. I'm not sure what the reason for the ID limitation is, but you could set the value of each option to the integer you want:
  12. Thanks for the report. It's hard to know when FormBuilder methods were added because there are no @since tags in the code. In v0.1.5 I've changed to older FB methods for better backwards compatibility.
  13. @AAD Web Team, if you're wondering why status!=hidden doesn't work in this selector it's because status keywords like that are only supported in PageFinder selectors like $pages->find() that query the database, and not by selectors that match against a PageArray in memory. And although the docs don't make this clear $page->parents() actually adds all the parents one by one into a PageArray and then filters that PageArray by the selector. See here. It is a bit confusing that $page->children($selector) goes through PageFinder but $page->parents($selector) doesn't.
  14. We're on the same wavelength - I meant turning it off in the Panel Selector. 🙂 Ending the session if/when someone does that sounds like a good idea.
×
×
  • Create New...