Tagged: advanced-layout-editor, Code block, Default editor, shortcode
-
AuthorPosts
-
January 26, 2022 at 5:29 pm #1337330
I am using the WP Knowledgebase plugin. The plugin adds a shortcode which you put on a page to create the knowledgebase there.
The plugin is working fine. When I use the default editor, I add a “shortcode” block, enter the shortcode, and the page works as expected. However, the styling is incorrect. The whole page has the background color of the header, and the page content is right up against the left side of the page.
When I switch to using the Advanced layout editor, it converts the shortcode block to a text block, and puts the shortcode in there. But visiting the page just renderes the shortcode as text rather than rendering the shortcode. I also tried using the ‘code block’ block (which in the description states shortcodes can be used) and get the same result.
Please advise on how to either use shortcodes within the advanced layout editor, or how to have page content correctly styled while using the block editor.
Thank you.
January 27, 2022 at 5:02 am #1337387Hey FRBjess,
Where can we see and reproduce the problem you are having?
Best regards,
RikardJanuary 28, 2022 at 9:07 pm #1337803Hi Rikard,
Thank you for the response. Unfortunately the site is within our internal network and is not available publicly. However I can give you steps to reproduce (and can provide additional info if you need).
Wordpress 5.8.3
WP Knowledgebase Plugin Version 1.3.4 (free version) located here https://wordpress.org/plugins/wp-knowledgebase/
Enfold Theme Version 4.8.8.1 (no child theme)
Import the business flat demoCreate three pages
KB_test_1 – Switch to the default editor. Enter some page content, just a line or two of text. My result: the text appears in the standard page template as expected, with a white background and appropriate padding between the page content and the window border/header/footer.KB_test_2 – Switch to the default editor. Use the shortcode block. Enter the knowlegebase plugin shortcode. Find the shortcode in Admin Panel -> Knowledgebase -> Settings -> General Settings -> Knowledgebase Slug. My slug is ‘knowledgebase’ so I entered
[knowledgebase]
in the shortcode block. Publush the page, and the shortcode will appear as text. Then go back to Admin Panel -> Knowledgebase -> Settings -> General Settings. Set the knowledgebase main page to KB_test_2. Also set Enable Search to true in the Knowledgebase Search section. Save changes. Refresh the page. My result: the knowledgebase page appears, with search at the top and categories of articles showing. However, rather than standard page styling, the page content is completely up against the header and the left side of the page, and the background color is set to a dark blue (but not the same as the header as I originally believed). See the linked screenshot for more detail.
KB_test_3 – Switch to the advanced layout editor. Add content elements – code block. The instructions for this block specifically state you can use plugin shortcodes here. Add the shortcode the same as from the previous step. Leave all other settings as their defaults. Save and publish the page. The shortcode will display as text. Now go to Admin Panel -> Knowledgebase -> Settings -> General Settings. Set the knowledgebase main page to KB_test_3 and save. Reload KB_test_3. My result: shortcode continues to be displayed as text and does not render.
I have another site that uses a different theme where using the shortcode renders the plugin content inside of the page container – that’s my desired behavior. If for some reason you are unable to replicate the issue, any information you can give me about using plugin shortcodes with enfold would be helpful.
Thank you.
February 1, 2022 at 4:27 am #1338108Hi,
Thanks for the update. I had a look at the plugin in question and it doesn’t look like a very popular plugin, and it has not been updated for over a year either. Maybe you could try an alternative plugin? We could try to reproduce the problems you are pointing out, but fixing compatibility issues for a plugin with only 3.000 active installations would not be a priority in our development process.
Best regards,
RikardFebruary 1, 2022 at 8:00 pm #1338309Hi Rikard,
I understand your reluctance to investigate a relatively unpopular plugin. Would you be able to give me general information about using plugin shortcodes? Are they supported at all in the advanced layout editor? Are there other plugins with shortcodes that are known to work with the advanced layout editor so I could see a working example?
Thank you.February 2, 2022 at 5:34 am #1338360Hi,
Thanks for the update. Plugin shortcodes should work in both the Text Block and Code Block elements. In your case, it sounds like the shortcodes are actually working, but not rendered properly?
Best regards,
RikardFebruary 2, 2022 at 6:25 pm #1338521The shortcode is working (but not rendering properly within the page container) when using the default editor. When using the advanced layout editor, the shortcode is not working at all.
February 3, 2022 at 5:02 am #1338603Hi,
Thanks for the update and clarification. Maybe you will have better luck with an alternative plugin?
Best regards,
RikardAugust 23, 2024 at 11:54 am #1465230I am having the same issue, but an alternative plugin is not an option. Different plugins / system to the above thread anyway.
When in Default editor the shortcodes within the shortcode block work exactly right, when switching to advanced layout editor to make a better looking page, the shortcodes do not work correctly either in a text box or a code box.
For our site there are two sets of open and close shortcodes to display different member-only content or message on a page. CvivCRM is being used, where the shortcode comes from.
We have it working perfectly throughout the site using default editor, but any time I want to change a post to advanced the shortcodes no longer work.August 23, 2024 at 1:02 pm #1465237Hi saucyhotdesign,
Sorry about your problem, but what I wrote earlier in this thread is still true. Solving problems with plugins with such a small user base is not on our priority list unfortunately.
Best regards,
RikardAugust 23, 2024 at 1:08 pm #1465240The plugin being used to show and hide content is Groups, with 10,000+ active installations – not big enough?
But in any case, should a shortcode that is working in default not also work on a code block in the advanced editor – I dont understand why it wouldn’t. I really need an explanation please, or are you just blaming the plugin?
August 25, 2024 at 3:15 pm #1465351Hi,
You can submit a feature request here, but there’s no guarantee that it will make it into the theme.
You can try using the shortcodes in Code Block element, it might work better there. The reason why it won’t work in the Layout Builder is because only theme shortcodes will be processed.
Best regards,
RikardAugust 25, 2024 at 11:39 pm #1465380Thanks Rikard, but I already tried in Code Block element – and that’s what I thought that was for, so question was about why that wasn’t working? Thanks.
August 27, 2024 at 9:38 am #1465481Hi,
Thanks for the update. I’m not sure why it’s not working unfortunately, we would have to investigate that further. The first step would be to submit a feature request though, and once or if we find the time to check this problem, then we could provide you with further answers.
Best regards,
Rikard -
AuthorPosts
- You must be logged in to reply to this topic.