Jump to content

Robin S

Members
  • Posts

    4,934
  • Joined

  • Days Won

    321

Everything posted by Robin S

  1. Yeah, it's not a solution. There is an open GitHub issue for this: https://github.com/processwire/processwire-issues/issues/349
  2. 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.
  3. Sounds very useful. Please share your module fork when you're ready.
  4. 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)");
  5. 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?
  6. 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);
  7. Maybe you are logged in to admin on Chrome but not in the other browsers?
  8. This is a good suggestion, but the action code would need to be modified in order to work in this case. By default that action copies the unformatted value from one field to another, but in this case the formatted value is needed in order for the newlines/markdown to be converted to HTML.
  9. For each field that you want to change to CKEditor, add a new CKEditor field to the template. Then use the API to set the formatted value of the textarea field to the CKEditor field. When you have done the API operations and checked that everything is okay you can delete the old textarea field. See here:
  10. Filling the bounding box is the standard behaviour for the size() method. $image->size(300, 200); For fit, I think it's a not a good idea to add background colour to the canvas. Better to use maxSize(), or size() with cropping set to false, and then center the image within the bounding box with CSS. But if you want to add a background colour you can do this with the canvas() method of Page Image Manipulator.
  11. You will need to use a repeating field type "Players" for the players. For me, the order of preference in terms of UI would be: 1. ProFields Table 2. Repeater 3. PageTable Within each item of Players you have two Page Reference fields - one for Player and one for Instrument. The safest thing would be to specify the instrument for every player in the Players field. But if the default instrument of a player is something that is fixed once selected (i.e. a player never changes their default instrument) then you could consider including the default instrument within the "Custom page label format" of the Player field. Then the instrument field could be named "Instrument override" and you only set it if the player is performing with something other than their default instrument. This would make it a quicker process to add players to a concert.
  12. The problem exists in 4.9 also unfortunately. But I think I may have traced the source of the issue. Code reference for 4.8.x but the solution is the same for 4.9. When localStorage for the editor contents is empty (which is the case the first time the Console panel is opened - I used localStorage.clear() during debugging) the value of Ace editor is set to the PHP $code variable (string). This string needs quotes around it when used as the argument for setValue(). tce.setValue('{$code}');
  13. Hi @adrian, With Tracy Debugger v4.8.24 (occurs in older versions too) on PW 2.7.2 the Console panel gives a JS error when opened. ace.js:1 Uncaught TypeError: Cannot read property 'match' of undefined at a.$detectNewLine (ace.js:1) at a.insert (ace.js:1) at a.setValue (ace.js:1) at b.setValue (ace.js:1) at <anonymous>:307:33 at HTMLScriptElement.script.onreadystatechange.script.onload [as onreadystatechange] (<anonymous>:43:33) I was able to reproduce this on a clean PW 2.7.2 installation with only Tracy installed.
  14. Hi @adrian, Could you please make a small change in ModuleSettingsImportExport.js to avoid an undefined variable error in PW 2.x? On line 11: var allModuleSettings = typeof ProcessWire !== 'undefined' && ProcessWire.config ? ProcessWire.config.allModuleSettings : config.allModuleSettings; I think this might be all that's needed for PW 2.x compatibility (although I haven't tested extensively). Thanks.
  15. It sounds like one of the factors that determines which roadmap items get attention first is the level of interest within the community (makes sense). But it would be good to have a more accurate and transparent gauge of the interest in each roadmap item. A simple solution would be to have an official Roadmap sub-forum with a topic for each roadmap item (separate from the Wishlist sub-forum). The community could then indicate their interest in each item by "liking" it, and give feedback or ideas about implementation in topic replies. My vote for most desirable roadmap item: Add support for custom properties in file/image fields.
  16. @flydev, thanks for the report. Looks like I didn't account for use of InputfieldPassword without an associated FieldtypePassword. Fixed in v0.1.5 (I changed to semantic versioning).
  17. $pages->addHookAfter('saveReady', function(HookEvent $event) { $page = $event->arguments(0); if(!$page->id) return; // Page ID is 0 when page is first created // Your code here });
  18. For me it works fine. I think the issue is here. Because the index may be 0 this line should be: if (HotkeysSettings.indexOf('removeNoticeHotkey') !== -1) {
  19. I opened a feature request topic about this in the ProCache sub-forum (not sure if you have access to that). Will be interesting to see if Ryan will consider adding such a feature.
  20. I've been working with FieldtypeOptions recently and in the absence of documentation thought I would share some example code: $field = $fields->get('test_options'); /* @var FieldtypeOptions $fieldtype */ $fieldtype = $field->type; // Get existing options // $options is a SelectableOptionsArray (WireArray) // If there are no options yet this will return an empty SelectableOptionsArray $options = $fieldtype->getOptions($field); // Create an option $yellow = new SelectableOption(); $yellow->title = 'Yellow'; $yellow->value = 'yel'; // if you want a different value from the title // Don't set an ID for new options - this is added automatically // Will deal with 'sort' property later // Create another option $orange = new SelectableOption(); $orange->title = 'Orange'; // Add option after the existing options $options->add($yellow); // Get an option by title $green = $options->get('title=Green'); // Insert option at a certain position $options->insertAfter($orange, $green); // Remove an option $options->remove($green); // Reset sort properties (so order of options is the same as the SelectableOptionsArray order) $sort = 0; foreach($options as $option) { $option->sort = $sort; $sort++; } // Set options back to field $fieldtype->setOptions($field, $options);
  21. If you've ever needed to insert links to a large number of files within CKEditor you may have found that the standard PW link modal is a somewhat slow way to do it. This module provides a quicker way to insert links to files on the page being edited. You can insert a link to an individual file, or insert an unordered list of links to all files on the page with a single click. CKEditor Link Files Adds a menu to CKEditor to allow the quick insertion of links to files on the page being edited. Features Hover a menu item to see the "Description" of the corresponding file (if present). Click a menu item to insert a link to the corresponding file at the current cursor position. The filename is used as the link text. If you Alt-click a menu item the file description is used as the link text (with fallback to filename if no description entered). If text is currently selected in the editor then the selected text is used as the link text. Click "* Insert links to all files *" to insert an unordered list of links to all files on the page. Also works with the Alt-click option. Menu is built via AJAX so newly uploaded files are included in the menu without the page needing to be saved. However, descriptions are not available for newly uploaded files until the page is saved. There is an option in the module config to include files from Repeater fields in the edited page. Nested Repeater fields (files inside a Repeater inside another Repeater) are not supported. Installation Install the CKEditor Link Files module. For any CKEditor field where you want the "Insert link to file" dropdown menu to appear in the CKEditor toolbar, visit the field settings and add "LinkFilesMenu" to the "CKEditor Toolbar" settings field. http://modules.processwire.com/modules/cke-link-files/ https://github.com/Toutouwai/CkeLinkFiles
  22. Welcome to the forums @mikhail $page->find() could be useful here. I think something like this should do the trick: // This category plus all child categories under it $categories = $page->find()->prepend($page); $pano_results = $pages->find("location_category=$categories, sort=-shoot_date, limit=10");
  23. Noooooooooo! You have been seduced by some other sexy CMF??? (The hussy!) Tell me it isn't true!
  24. Hi @tpr, Could you please give some comment about where things stand with AOS with regard to AdminThemeUikit? Have you done much testing with the Uikit theme and would you say that AOS is officially supports the Uikit theme at the moment? So far I have been holding off switching to the Uikit theme - for a few reasons, one of which is that AOS is a pretty important part of my custom profile and I want to be sure the module works well with the theme before I switch my clients over to it. I haven't tested AOS much with the Uikit theme but at a quick glance I noticed a few things that made me think that the theme might not be officially supported by AOS yet. AOS toggle/config link doesn't align with the left edge of the content container: Module config icon position is a bit off and icon is fuzzy (wrong size?): Also, the Escape key does not clear the notices. No pressure if AOS is not ready for AdminThemeUikit yet - just wanted to check.
  25. The problem is here. The description of InputfieldSelector/FieldtypeSelector is "Build a page finding selector visually" (my emphasis). The inputfield returns a string that is suitable for using with the PW PageFinder - so you can use it with methods that query the database such as $pages->find($selector) or $page->children($selector) but it isn't guaranteed to work with in-memory selectors like $some_pagearray->find($selector), $some_pagearray->not($selector), etc. In your case a simple solution would be to use your Selector field to define the selector for pages that will appear in the menu (rather than what you don't want to appear in the menu). So you would set this in your Selector field... template > Not Equals > event ...and then use it in your template like this... function getSettings() { return pages()->get('/site-settings/'); } $home = $pages->get('/'); foreach ($home->children(getSettings()->menu_filter) as $childPage) { // ... }
×
×
  • Create New...