Overriding default gallery in Gutenberg
I've updated the software to the latest version, but our Royal Slider doesn't appear to override the block gallery function any longer. I now see the RoyalSlider block in the editor, but there are no options on the right side and it just says no sliders available.
We have been using NRS for years to override the default WP gallery with a carousel slider. Any suggestions for a workaround or a step we are missing in the process?
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Dmitry Semenov on 06 Feb, 2019 10:17 PM
Hello,
Default Gutenberg gallery block does not support overriding, https://github.com/danielbachhuber/gutenberg-migration-guide/blob/m... They promise to add
post_gallery
filter support in the future, but for now there is no such option and there is no ETA when it'll be added.But
[gallery]
shortcode can still be overridden, as it's unchanged. To add it to Gutenberg you may use either "shortcode block" or "classic editor" block.Or you may keep using old WordPress post editor by installing Classic Editor plugin https://wordpress.org/plugins/classic-editor/
2 Posted by josh on 03 Apr, 2019 08:22 PM
How do I use a shortcode with an existing gallery created in Gutenberg?
When I click on the block HTML, I do not see a gallery ID.
Support Staff 3 Posted by Dmitry Semenov on 03 Apr, 2019 08:26 PM
Gutenberg does not allow to convert gallery Block to gallery Shortcode, as far as I know. So if you need specifically [gallery] shortcode - you'll need to use "shortcode" block and add gallery manually inside it.
4 Posted by theMikeD on 20 Aug, 2019 10:07 PM
https://github.com/WordPress/gutenberg/pull/11540
Would this do the trick? I rely upon over-riding default galleries with RS, so this one issue will force me to hold back switching to gutenberg.
Happy to help do the coding if you point me in the right direction.
Support Staff 5 Posted by Dmitry Semenov on 21 Aug, 2019 03:19 AM
@theMikeD,
if you'll be able to retrieve attachment ids and replace HTML output of the default block, you may use this technique to generate RoyalSlider - http://help.dimsemenov.com/kb/wordpress-royalslider-tutorials/wp-cr...
And thanks for the link, I'll investigate.
6 Posted by Sas on 02 Oct, 2019 03:30 PM
Heya,
We also had some luck with this: https://antistatique.net/en/we/blog/2019/01/29/gutenberg-override-core-blocks-rendering
Cheers,
7 Posted by theMikeD on 10 Sep, 2020 07:34 PM
Is there a solution to this yet?My hack is the following: