Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/18/2022 in all areas

  1. Yes, that is true! Sorry I didn't understand that the template of your pageclass does not exist yet! MagicPages can only be loaded if the template exists, therefore you need to make sure that the template is being created before you can actually use the migrate() method. RockMigrations has the "migratePageClasses()" method for that: https://github.com/baumrock/RockMigrations/blob/d429872cbcb6d658352844fb612ee4a10baa57a2/RockMigrations.module.php#L2311 And it's documented in the WIKI how to do it (also setting parent-child relationships which is a common need): https://github.com/baumrock/RockMigrations/wiki/Ship-your-Module-with-Custom-Page-Classes Thx for the question, I've made the docs a little clearer about that ?
    3 points
  2. It took some investigating and it would be great to have this made more obvious in any documentation for $config->pagefileSecure... Behind the scenes pagefileSecure is using $files->send(): And $config->fileContentTypes forces download for certain extensions based on whether the content type is preceded by a + sign. You can override the default for the pdf extension in your /site/config.php and then the files should display in the browser: $config->fileContentTypes('pdf', 'application/pdf'); // No plus sign before the content type
    3 points
  3. just to make sure, did you copy/paste this from your code? There is a typo "Imput", note the "m". It should read "getModuleConfigInputfields" To retrieve module config data from anywhere you can also use https://processwire.com/api/ref/modules/get-config/
    3 points
  4. Here you are referring to ProcessModules. These provide custom pages in the admin. For an example see https://processwire.com/modules/process-hello/ and I also can strongly recommend the excellent blog post about ProcessModules linked by @BillH This is correct. You can read all about module configuration at https://processwire.com/blog/posts/new-module-configuration-options/ with examples both for the "old" and "new" way to implement your custom configuration fields. There is no settings button on the module's detail page. Once you have implemented input fields for module configuration, they will appear underneat the module information. All configurable modules are also listed in the admin menu under Modules->Configure When you are new to module development, the available classes can be quite confusing. But once you try and build a module yourself everything will get clearer. If you want to build custom pages in the admin, use a process module (https://processwire.com/modules/process-hello/). If you want to add general functionality, use a "normal" module (https://processwire.com/modules/helloworld/). This is because the API docs are auto-generated from the PW code. Since ConfigurableModule is an interface and not a class, the documentation for it is not being picked up by the script that generates the docs. But you have the path to the file in the core that defines the interface and there you have extensive documentation https://github.com/processwire/processwire/blob/master/wire/core/ConfigurableModule.php
    3 points
  5. Config variables should be available as properties of the module if I'm not missing anything. So if you add a config inputfield with the name 'foo' it should be available as $this->foo. Or from outside the module it should be available as $modules->get('YourModule')->foo;
    3 points
  6. https://50thbirthday.londonfriend.org.uk/ This is a site we created to celebrate the 50th anniversary of London Friend which is the UK's oldest LGBTQ+ charity. It has a timeline that covers significant events of the charity's history together with a showcase of 50 inspirational Londoners who have made a difference to life in the capital. The technical side of things is pretty much as you imagine. One choice we made was not to use ajax for loading the timeline events but instead loading all of the html and then leaning hard into caching and lazy loading of images. We did use @markus_blue_tomato 's imageBlurHash module to produce placeholders for our lazily loaded images - although honestly you rarely get to see them. For some of the pages the client wanted to be able to add footnotes so we created a text formatter than moves any text in a content block surrounded in square brackets into footnotes section and creates an anchor link. I'll tidy that up and pop it on GitHub when I get some time but feel free to nag me if you think it might be useful to you. Other modules of note were ProCache and (of course) TracyDebugger. We also have some galleries on the site that use PhotoSwipe which is still our g to script for phot galleries. We got great marks in Lighthouse, Observatory and Wave (even the timeline itself which is a complicated page still does very well). It was great to be part of the celebrations (just a shame that I'm on holiday when the launch party happens... dammit)
    2 points
  7. Yeah, my links are already opening in a new tab. That's not the issue. The issue is that, when using pagefileSecure, files are being delivered to the browser from a ProcessWire process rather than a normal file request directly from the server. That's intended; however, browsers sometimes have issues interpreting files delivered by PHP, and that's often due to the headers used (Chrome might think it's being presented with a file it can't display, so it goes directly to a download dialog). I was hoping to not have to develop a downloader of my own to replace the user side of pagefileSecure, particularly for what should be such a basic use case, but looks like I'll need to attempt that. Thanks for the suggestions gebeer. Update: I figured that I was going to have make a number of additions to gebeer's code above, such as working in the pagefileSecure prefix and various header changes... but it worked right away, pretty much as is! No issues at all in Chrome or Edge. Sweet. I'm still going to have to come up with a textformatter for links that exist within CKEditor fields, and will circle back to this thread once I have that coded and working.
    2 points
  8. We have created a module to create BlurHash strings for images while uploading in ProcessWire. This blurry images will be saved in the database because they are very small (20-30 characters) and can be used for Data-URL's as placeholders for image-lazy loading. https://github.com/blue-tomato/ImageBlurhash E.g. where we use this in production: https://www.blue-tomato.com/en-INT/blue-world/ https://www.blue-tomato.com/en-INT/blue-world/products/girls-are-awesome/ https://www.blue-tomato.com/en-INT/buyers-guides/skateboard/skateboard-decks/ https://www.blue-tomato.com/en-INT/team/anna-gasser/
    1 point
  9. Hi Ivan, sorry, there's currently no new version. I haven't had the chance to update to a newer FormBuilder release yet, that's on my schedule for December. That will also be the time to give FB Multiplier a bit of an overhaul.
    1 point
  10. Just yesterday I thought about that topic... I saw that Tracy uses a custom color that comes from the reno theme I think? Is that one example for what you mean @gornycreative ? Do you mean that the module should pick up the default color (in my case my #00BB86 baumrock-green) rather than the reno-red? I'm not sure how we could do that best, but I'm quite sure if we find a concept that works and makes sense and explain it to Ryan he'd be helpful in implementing that or to add some kind of procedures/guidelines. Personally I think that the rock theme should be the default. Not because I built it, but because it is close to the default UIkit theme (that was the goal of the style). UIkit already comes with the necessary standards (like having a proven concept of colors primary/secondary/muted). The reno theme is imho an opinionated set of overrides on top of that (or should be). One restriction would be that the primary color needs to be a dark color with good contrast to white. So that all UI elements having a primary color are well visible on white screens and can have white as text color. I'm not sure how that would work for a dark mode switch? Maybe the best would be to create a demo-module that implements our concepts?
    1 point
  11. Good day @BitPoet! This module doesn't seem to work with latest FormBuilder. Are you planning to maintain it and fix issues? Maybe there is already a newer version, just not in the repo?
    1 point
  12. Asked this question privately to Bernhard, his reaction included I have been digging into RockMigrations and I'm trying to learn the workflow. I have the following MagicPage. <?php namespace ProcessWire; use RockMigrations\MagicPage; class ProjectPage extends Page { use MagicPage; public function migrate(): void { $rm = modules('RockMigrations'); $rm->migrate([ 'fields' => [ 'project_short_description' => [ 'type' => 'FieldtypeTextarea', 'label' => 'Beschrijving', 'notes' => 'Korte beschrijving zichtbaar op andere pagina\'s', 'rows' => 5, 'columnWidth' => 50, 'icon' => 'align-left', 'description' => '', 'inputfieldClass' => '', 'contentType' => 1, ], 'project_description' => [ 'type' => 'FieldtypeTextarea', 'label' => 'Inleidende beschrijving', 'rows' => 5, 'columnWidth' => 50, 'icon' => 'align-left', 'description' => '', 'inputfieldClass' => '', 'contentType' => 1, ], 'project_client' => [ 'name' => 'project_client', 'label' => 'Opdrachtgever', 'type' => 'FieldtypeText', ], 'project_subtitle' => [ 'label' => 'Subtitel', 'type' => 'FieldtypeTextarea', 'rows' => 2, ], 'project_state' => [ 'label' => 'Status', 'type' => 'FieldtypeSelect', 'select_options' => '1:=In voorbereiding 2:=In uitvoering 3:=Gerealiseerd', 'columnWidth' => 33.33334, ], 'project_number' => [ 'label' => 'Aantallen', 'type' => 'FieldtypeText', 'columnWidth' => 33.33334, ], 'project_partners' => [ 'label' => 'Partners', 'type' => 'FieldtypeText', 'columnWidth' => 33.33334, ], ], 'templates' => [ 'project' => [ 'fields' => [ 'title', 'project_short_description', 'project_description', 'project_client', 'project_subtitle', 'project_state', 'project_number', 'project_partners', ] ], ] ]); } } I have removed all the fields and templates that are in this migration. I was expecting the migration to execute when updating the migration inside the MagicPage and create all the fields and the template. This however works only if I add to migrate.php: $rm->migrate(['templates' => ['project']]); Is it possible to trigger the RM via MagicPage only? Or is this by design (Now that I think about it I can imagine you may want to have the MagicPage file in your project but not let it trigger)? ------ @bernhard's reply: ------- I have tested this, but in the case I have not created a 'project'-template yet, this will not trigger. I believe the Custom Page Class will only be triggered if you actually have a template with that name. As soon as I create a project template the migrate will trigger (which is fine for me).
    1 point
  13. Sure @snck that sounds like a great addition. I'm not using Scss at the moment though so I'd be happy if you can provide a PR maybe? The magic happens here: https://github.com/baumrock/RockFrontend/blob/e1ba2acb58967fe0cdf7cdc890b54870c5935082/StylesArray.php#L182 So we could just add another line below: $this->parseScssFiles($opt); You'd just need to implement that method based on the parseLessFiles() method ?
    1 point
  14. Looks like you might not have installed the MigratorWordpress plugin. Also, please note that it really only works on WP blog posts and it's also not being maintained anymore. Good luck!
    1 point
  15. Great! Was about to dig into RockMigrations tomorrow. So happy to see you so active! Thanks a lot!
    1 point
  16. I'm really happy with InputfieldTinyMCE so far. And as threatened to in reply to an earlier core updates post, I took a stab at migrating my autocomplete module over from InputfieldCKEditor. All in all, it was quite a pleasant experience and the JS side was really straight forward. The change also involved a lot of refactoring, and in the aftermath of that there's still a good bit of house cleaning to do, but for anybody willing to toy around with it, there's an alpha release of InlineCompleteTinyMCE on GitHub. A snapshot of InlineCompleteTinyMCEActionUsers in action: And the corresponding configuration in the field's "Input" tab (added to the TinyMCE config section): I haven't tested it with lazy loading or the inline editor yet.
    1 point
  17. New video is out: Quickstart for RockMigrations ?
    1 point
  18. Some of your questions will be answered by reading through the articles listed at https://processwire.com/docs/modules/, particularly the first three. Also really helpful are the Hello World example modules described in the blog post https://processwire.com/blog/posts/pw-3.0.181-hello/. And another excellent post is https://processwire.com/blog/posts/building-custom-admin-pages-with-process-modules/. These will probably give you enough to start building useful modules. And I'd suggest that building a module or two (especially by following examples) would be the best way to get started, working things out as needed.
    1 point
ร—
ร—
  • Create New...