-
Posts
499 -
Joined
-
Last visited
-
Days Won
31
FireWire last won the day on November 21 2024
FireWire had the most liked content!
About FireWire
- Birthday January 1
Profile Information
-
Location
California
-
Interests
Writing code. Writing more code. Refactoring. Writing code.
Recent Profile Visitors
10,915 profile views
FireWire's Achievements
Hero Member (6/6)
966
Reputation
-
Hey @bernhard not an issue with RPB but something that I tweaked to help out in a situation that came up while working. I deleted a settings array in settings.php and then didn't touch that project for almost a week. When I came back to it I got an error when trying to edit a page. I didn't realize that one of the block files was attempting to use the global setting that I had deleted. I was able to read through and find out what I did wrong but I had to check back and forth between the block file and settings.php to figure out which one was missing. I added this and it creates a more descriptive stack trace that can save some time. <?php public function use($arr): BlockSettingsArray { $result = new BlockSettingsArray(); foreach ($arr as $name) { $blockSettings = $this->get($name); // Now if I try to use a global settings array that doesn't exist it shows the missing settings name if (is_null($blockSettings)) { throw new LogicException( "Could not find settings with the name '{$name}'. Does it exist?" ); } $result->add($blockSettings->getArray()); } return $result; } This helped me while managing blocks and settings in different files, and also because I leave my work in a broken state for long enough to forget what I did 😆
-
@David Karich That would be a great feature. I've scanned the API docs and the solution would put the work of managing glossaries entirely on Fluency. I'm familiar with the feature but am learning more in depth about it right now. Bummer. The process of managing them is also a bit of a task: Of course all of this is doable and I'd like to take it on but I'm really overloaded right now with work. I may be able to hack around a little bit but unfortunately couldn't provide a guarantee or estimate on when it could be added to the module. It's definitely a feature I'd like to have on the roadmap. If I have some time I can put towards it I will. Sorry I can't be of more help at the moment 🫤
- 223 replies
-
- 1
-
- translation
- language
-
(and 1 more)
Tagged with:
-
@bernhard I'll do some more testing myself and come back with anything I can find.
-
@Stefanowitsch Thank you very much for taking the time to check. It's gotta be something odd on my end or some conflict unique to my case.
-
Copied and pasted, still not working for me. Not sure what it is but if it's working for you it has to be some sort of conflict on my end. When I have time I'll do some digging and come back with anything I find. Thanks for checking it out!
-
Great tweaks, and I just learned about insertBefore()/insertAfter() for the first time. Excellent!
-
@bernhard Awesome! 🙌
-
FireWire started following Weekly update – 17 January 2025 and New blog – What’s new in ProcessWire 3.0.244?
-
New blog – What’s new in ProcessWire 3.0.244?
FireWire replied to ryan's topic in News & Announcements
@ryan So many great new and exciting features. A few are gamechangers. Thank you for all the hard work by both you and contributors. Repeater page classes are 🤌- 1 reply
-
- 6
-
@ryan The right choice! Enjoy!
-
FireWire started following Settings showIf not showing if
-
I tried to create a showIf with two select fields but couldn't get it to work properly. I copy/pasted the example from the docs directly in case I was missing something but I still can't get it to work. My attempt: <?php $settings->add([ 'name' => 'image_location_horizontal', 'label' => 'Image Location', 'value' => $field->input('image_location_horizontal', 'select', [ '*right' => 'Right', 'left' => 'Left', 'center' => 'Center', ]), ]); $settings->add([ 'name' => 'body_location_vertical', 'label' => 'Body Location', 'value' => $field->input('body_location_vertical', 'select', [ '*above_feature' => 'Above Feature', 'below_feature' => 'Below Feature', ]), 'showIf' => 'image_location_horizontal=center', ]); Tried searching to see if this has come up for anyone else but didn't see anything.
-
@bernhard Humble suggestion for docs 🙂 Nothing critical but noticed as a regular user of RPB. <?php // For global settings, it may be useful to add an example of setting the order when using local settings with prepend(). public function settingsTable(\ProcessWire\RockFieldsField $field) { $settings = $this->getGlobalSettings($field) ->use([ 'style', 'demo-checkbox', ]); $settings->prepend([ 'name' => 'prepended-custom-checkbox', 'label' => 'Prepended custom checkbox', 'value' => $field->input('prepended-custom-checkbox', 'checkbox'), ]); $settings->add([ 'name' => 'custom-checkbox', 'label' => 'Custom checkbox', 'value' => $field->input('custom-checkbox', 'checkbox'), ]); return $settings; } //----------- // Under the simple checkbox example it shows how to call the add method but doesn't specify where the $settings variable is initialized $settings->add([ 'name' => 'demo-checkbox', 'label' => 'Demo Checkbox', 'value' => $field->input('demo-checkbox', 'checkbox'), ]); // May be good to show a settings table that doesn't use globals initialize the $settings variable. It's in the default stub, but may be helpful anyway public function settingsTable(\ProcessWire\RockFieldsField $field) { $settings = $this->getDefaultSettings($field); $settings->add([ 'name' => 'demo-checkbox', 'label' => 'Demo Checkbox', 'value' => $field->input('demo-checkbox', 'checkbox'), ]); return $settings; } New settings are working perfectly, love the upgrade 👍
-
Story of my/our lives. HA. Thank you for your work on this, it looks great and the syntax is very nice. Excellent work 🙌
-
@bernhard It was completely my oversight, I didn't know that RPB already had a solution for managing settings to be used globally. So it wasn't due to anything other than not knowing about it ahead of time. I like this implementation! Very elegant. Having it in the RPB templates folder is great and that array definition style is really intuitive.
-
@bernhard Maybe I should mark this post as "solved" 😆
-
@bernhard Of course you thought of this... I need to go back and read the docs more ha! I completely missed that. Everyone save yourself the trouble and RTFM 🤣