Jump to content

Robin S

Members
  • Posts

    5,008
  • Joined

  • Days Won

    333

Everything posted by Robin S

  1. VisBug looks nice indeed:
  2. That's a good point, thanks. Have changed to left alignment in v0.1.5. Not sure I want to make this change as if the show original field width config option is enabled it makes the label a bit disconnected from the input, and for longer field names in narrower columns (esp. on narrower screens) it increases the likelihood of the field name not fitting within the column width. Having the field label break to underneath the input wouldn't be great. So I'm thinking the costs aren't worth the benefit of slightly more efficient use of vertical space. But if others would prefer everything on a single line I'm willing to reconsider. Yeah, not sure I'm up for tackling that, but if you're tinkering around some time and find a solution that would be cool. ?
  3. Good solution, but a couple of things: 1. It would be sensible to add a few restrictions about what page can be retrieved by the $pages->get(). The page ID is user input so potentially any page ID could be inserted into the URL allowing a user to see pages that they should not have access to: unpublished repeater pages, or indeed any page including admin pages could be rendered (although PW has extra checks here that would probably prevent anything sensitive from being disclosed). Something like this would be safer: $id = $sanitizer->int($input->urlSegment1); $match = $pages->get("id=$id, template=repeater_your_repeater, status!=unpublished"); 2. Calling $match->render() will only produce output if a template file exists for the repeater, which is normally not the case. It's possible to add a repeater template file but it might be easier to echo individual field values from $match.
  4. Thanks, fixed in the latest version.
  5. v0.1.3 adds a tabbed interface for fieldset tabs, and there is a new config option to show the original field width alongside the template context field width.
  6. My objective is to avoid needing to mouse to and click anything in the "Field widths" field. Right now I can use the tab key to move through all the fields, but if some fields are inside a hidden tab content div then I suspect it may be quite difficult to keep this functionality. If it were just a matter of showing the tab content with the focused field that would be fairly simple, but I suspect the browser will refuse to focus an input inside a hidden div (I haven't checked yet). In the PageEdit/WireTab example, PW will not move focus from the last field in Tab A to the first field of Tab B using the tab key.
  7. Personally I would find that more distracting than useful, but will look at adding it as a configurable option. I can see why this would be good, but I wouldn't want to lose the ability to use the tab key to move through all fields in the template. Will do some experimenting and see if it's possible to keep the tab key navigation in a tabbed interface - I have a feeling that hidden inputs may not be focusable with tab.
  8. I think this might be one of those cases where a little debugging saves a lot of head-scratching. Try dumping the value you are trying to match: Now it's obvious what the cause of the issue is. The title field has the entity encoder textformatter applied (like all text fields should), so the formatted value that is prepared for display on the front-end is different than the unformatted value that is saved in the database and that you are searching against with $pages->find().
  9. Looks cool! Does your script parse out the version number from the getModuleInfo() method / ModuleName.info.php file / ModuleName.info.json file? If so, would you be willing to share the code from that part? I have an idea in mind for how to do this but it would be no surprise if your idea was better. ?
  10. @matjazp, thanks for the suggestions. Yes, done in v0.1.2 Sorry, no, if I'm wanting numbers to sum to exactly 100 then I much prefer a number input than a slider. Just tab from field to field and it's very quick. Great idea, done in v0.1.2
  11. This might be a question only @ryan can answer, or maybe someone know if Ryan has ever shared the code used in the PW Modules Directory... I want to make a module similar to ProcessWireUpgrade except for private modules that are not in the modules directory. I haven't decided yet exactly how this will work (get each module info on demand direct from the repo or set up a private modules directory that gets several module's info on a lazycron), but part of it will need to be parsing the version number from the getModuleInfo() code in the module repo. I can probably muddle through this but rather than reinvent the wheel, is it possible to see how the PW Modules Directory does it?
  12. emplate Field Widths Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template. Since v0.2.0 the module also adds a similar field to the settings of Edit Field for Repeater, FieldsetPage and Repeater Matrix allowing you to quickly set the widths of inputfields within the Repeater/FieldsetPage field, or within each Repeater Matrix type. Note: widths are only saved if the edit form is submitted with the "Field widths" field in an open (non-collapsed) state. Edit template Edit Field: Repeater Edit Field: Repeater Matrix Why? When setting up a new template/repeater or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process. Config options You can set the default presentation of the "Field widths" field to collapsed or open. Widths entered into the "Field widths" field are only applied if the edit form is submitted with the field in an open (non-collapsed) state. "Collapsed" is the recommended setting if you think you might also use core inputs for setting field widths in a template context. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width. https://github.com/Toutouwai/TemplateFieldWidths https://modules.processwire.com/modules/template-field-widths/
  13. I haven't yet had the need to work with the Login/Register module but given that it's by Ryan, lead developer of ProcessWire, I think it's safe to say it's a well-made module that is very ProcessWire-y. Login/Register is a relatively recent module, and I believe it's intended for scenarios where you want bog-standard login/register features without having to think much about it. It's probable not intended for scenarios where you want specific custom behaviour. In those cases you would use the PW API to code exactly the features you want, which is what people did for all frontend-user needs before Login/Register was released. Here is a forum topic and some helpful gists from @Soma that can get you started with the PW forms API: PW simple form via API: https://gist.github.com/somatonic/4027908 Create a page edit form on frontend using PW API and fields from the template of the page: https://gist.github.com/somatonic/5011926 And of course Login/Register uses the PW API so study that for sure.
  14. It's okay to use a page/template for an AJAX response, but if you're using a delayed output approach with an auto-appended main.php file then remember to disable that for your AJAX template: Edit Template > Files > Disable automatic append of file...
  15. [joke]You're gonna hate underscore.js then[/joke] ?
  16. @adrian, I've added a substitute getPageIndex() method to the module so the issue should be fixed in v0.1.12. Probably not as efficient as the core Traversal methods but should be okay unless you have a massive number of siblings.
  17. Thanks, seems like a core issue with Page::index(): https://github.com/processwire/processwire-issues/issues/751 Will see if I can find a workaround for the short term.
  18. @d'Hinnisdaël, thanks for the report. FieldsetClose needed to be excluded - fixed in v0.1.3.
  19. In v0.1.2 I've added some warning notices in case AdminThemeUikit is installed but not in use.
  20. No, AdminThemeDefault and AdminThemeReno do some crazy JS spacer stuff to equalise field heights. This module relies on the flex layout used in AdminThemeUikit. Possibly, but not sure what the point of that would be. The module already requires AdminThemeUikit in order to be installed and also clearly states that in the readme. And if you have AdminThemeUikit installed but you allow some users to choose a different theme then using this module is not going to be a good idea. Best just not to install it in that case.
  21. Right you are, I overlooked that part of your post. Taking another look at it I think the issue is that you need to specify the subfield of the page you are wanting to match against. Assuming it's the title it would be: $myBlogsStart = $bl->pages->find("template=page-blog, category_relationships_conditions.title=$query, sort=title");
  22. Personally speaking, when it comes to page relationships I use... Page Reference fields: regularly The Page Field Edit Links module can be very useful for creating new pages or editing pages directly from the field via a modal. And the AsmSelect inputfield option has support for modal page editing built-in. You might find the Connect Page Fields module useful for automatically creating two-way relationships. Parent/child structure: sometimes, when it makes sense. PageTable fields: rarely
  23. Glad you like it. ? Done, in v0.1.1.
  24. I've never actually used this module, but looking at the module code I think this will work: if(empty($options['pageTableExtended']) && empty($options['pageStack'])) throw new Wire404Exception();
  25. Not sure about the selector sanitizing, but assuming category_relationships_conditions is a Page Reference field it seems like you could simplify things and avoid the issue at the same time by using the page object in the selector: foreach($page->category_relationships_conditions as $crc) { $myBlogsStart = $bl->pages->find("template=page-blog, category_relationships_conditions=$crc, sort=title"); // ...
×
×
  • Create New...