Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/18/2025 in all areas

  1. You mean, type them in a text area with the spaces, like in the example above? Seems like it would be a pretty complex PHP script, but possible, I guess... If you don't mind to write something closer to the html code, it would make it really easy. You could simply wrap the notes in an element by making them bold, and make each line a paragraph: EI'll take you Dfor a rGideB EOn my gaDrbage tGruckB BOh noA And then just add something like this to style it. p { position: relative; margin-top: 1.5em; } strong { position: absolute; bottom: 1em; color: red; font-weight: inherit; } Or, if you need exactly the html code from above, do a str_replace in a text formatter from "<strong>" to "<span class='chord'>" and so on...
    1 point
  2. Awesome, thank you! This works perfectly and I have never allowed images in RTE fields, so I'm safe here 🙂 Thx for the note! I have added this as a tweak to RockAdminTweaks: https://github.com/baumrock/RockAdminTweaks/blob/dev/tweaks/General/RemoveVariations/RemoveVariations.php
    1 point
  3. I'm not sure if it's a solution to your issue, but I have this hook in every site (see the referenced issues for background): // Instead of rebuilding image variations, remove them and they'll be rebuilt when next requested // Fix for: https://github.com/processwire/processwire-issues/issues/1301 // Also see: https://github.com/processwire/processwire-issues/issues/1277 $wire->addHookBefore('Pageimage::rebuildVariations', function(HookEvent $event) { /** @var Pageimage $pageimage */ $pageimage = $event->object; $event->replace = true; $pageimage->removeVariations(); // Return expected output to avoid errors $event->return = [ 'rebuilt' => [], 'skipped' => [], 'reasons' => [], 'errors' => [], ]; }); It's only safe to do this if you do not allow image variations to be directly inserted into RTE fields. More info in this comment: https://github.com/processwire/processwire-issues/issues/1301#issuecomment-893957331
    1 point
  4. $pages->findRaw() will be helpful here. It's hugely faster than $pages->find() and easier to work with than SQL queries. You could do a couple of searches and connect the resulting data by repeater page ID. Example: // Ensure PagePaths module is installed so that URL is available to findRaw() $shop_data = $pages->findRaw("template=shop", ['title', 'url', 'locations'], ['nulls' => true, 'flat' => true]); // Here you could also get other fields from the repeater pages as needed $location_data = $pages->findRaw("template=repeater_locations, check_access=0", ['location'], ['nulls' => true, 'flat' => true]); $shops = []; // Loop over the shop data and get the lat/lng for each location, matching by repeater page ID foreach($shop_data as $id => $item) { $data = [ 'title' => $item['title'], 'url' => $item['url'], 'locations' => [], ]; $location_ids = explode(',', $item['locations.data']); foreach($location_ids as $location_id) { if(!isset($location_data[$location_id])) continue; $data['locations'][] = [ 'lat' => $location_data[$location_id]['location.lat'], 'lng' => $location_data[$location_id]['location.lng'], ]; } $shops[$id] = $data; } db($shops);
    1 point
  5. I think URL hooks can be a good solution for this case: https://processwire.com/blog/posts/pw-3.0.173/
    1 point
  6. @Cybermano you could also use this module I made https://processwire.com/modules/page-mjml-to-html/, though you lose the ability to see your changes live in VSCode. Pros and cons like @bernhard says 🙂
    1 point
  7. With regard to the documentation, it would be quite good to have newer features that have been mentioned in this weekly update or blog posts incorporated in the main documentation. Possibly also some of the pro modules stuff, as at the moment documentation is scattered around either in the forum or on the shop pages to purchase the pro modules. While it makes sense for discussion to be in the forum for people with up to date subscriptions, having documentation in one place might be a help, and might even convince people to buy pro modules if documentation for how they can use them is available. I notice with Lister Pro, there is some documentation in the API reference under Lister with core lister methods and properties and Lister Pro methods listed together but pro methods and properties identified.
    1 point
  8. Regarding the API reference, I always wondered if there could be a way for you to add links to pages that reference a particular method and go in deeper details about its usage. One such case could be to link the blog post about output formatting in the $page->of() documentation. Maybe there’s already something in place like this and then it may just be a question of adding/updating links. Thanks and I’m (we’re all!) looking forward to seeing the new website! (and I hope all goes well for your HVAC installation)
    1 point
  9. I created this module a while ago and never got around to publicising it, but it has been outed in the latest PW Weekly so here goes the support thread... Unique Image Variations Ensures that all ImageSizer options and focus settings affect image variation filenames. Background When using methods that produce image variations such as Pageimage::size(), ProcessWire includes some of the ImageSizer settings (height, width, cropping location, etc) in the variation filename. This is useful so that if you change these settings in your size() call a new variation is generated and you see this variation on the front-end. However, ProcessWire does not include several of the other ImageSizer settings in the variation filename: upscaling cropping, when set to false or a blank string interlace sharpening quality hidpi quality focus (whether any saved focus area for an image should affect cropping) focus data (the top/left/zoom data for the focus area) This means that if you change any of these settings, either in $config->imageSizerOptions or in an $options array passed to a method like size(), and you already have variations at the requested size/crop, then ProcessWire will not create new variations and will continue to serve the old variations. In other words you won't see the effect of your changed ImageSizer options on the front-end until you delete the old variations. Features The Unique Image Variations module ensures that any changes to ImageSizer options and any changes to the focus area made in Page Edit are reflected in the variation filename, so new variations will always be generated and displayed on the front-end. Installation Install the Unique Image Variations module. In the module config, set the ImageSizer options that you want to include in image variation filenames. Warnings Installing the module (and keeping one or more of the options selected in the module config) will cause all existing image variations to be regenerated the next time they are requested. If you have an existing website with a large number of images you may not want the performance impact of that. The module is perhaps best suited to new sites where image variations have not yet been generated. Similarly, if you change the module config settings on an existing site then all image variations will be regenerated the next time they are requested. If you think you might want to change an ImageSizer option in the future (I'm thinking here primarily of options such as interlace that are typically set in $config->imageSizerOptions) and would not want that change to cause existing image variations to be regenerated then best to not include that option in the module config after you first install the module. https://github.com/Toutouwai/UniqueImageVariations https://modules.processwire.com/modules/unique-image-variations/
    1 point
×
×
  • Create New...