#80 – Wbamp show and hide shortcodes with Beaver Builder

Posted in ‘weeblrAMP’
This is a public ticket. Everybody will be able to see its contents. Only enter usernames, passwords or any other sensitive information in the Private information field.
Thursday, 10 May 2018 22:39 UTC
hugovandrunen
 
[wbamp-show start] shortcodes with Beaver Builder can be used with modules Text Editor or HTML block.

Within Text Editor I can put an image between [wbamp-show start]...[wbamp-show end] it works fine, the image shows only on Amp pages. And in the Beaver Builder Edit Mode, I can see and open the Text Editor and make changes.

Now if I want a Gallery, only on AMP, I need a Gallery Module, between two HTML Modules containing [wbamp-show start] and
[wbamp-show end] respectively. When creating a block like that Beaver shows the shortcodes and I can edit. But if I come back after publishing only the HTML Module containing [wbamp-show start] is visible, the gallery and the ending shortcode are gone.

A solution to see and edit this AMP content is to change temporary the opening HTML to [wbamp-show start][wbamp-show end]
But that means: enter edit, change the HTML, save or publish, enter edit, edit, delete the temporary [wbamp-show end], and save/publish. And a common user may think the amp content is gone, and not think about a trick like this.

Maybe you can change your shortcode so that Amp is hidden on desktop, except when editing (with Beaver Builder in this case)

Best regards
Friday, 11 May 2018 07:58 UTC
wb_weeblrpress
Hi

Now if I want a Gallery, only on AMP, I need a Gallery Module, between two HTML Modules containing [wbamp-show start] and

[wbamp-show end] respectively. When creating a block like that Beaver shows the shortcodes and I can edit. But if I come back after publishing only the HTML Module containing [wbamp-show start] is visible, the gallery and the ending shortcode are gone.
You mean in the admin? That very much looks like a bug in BeaverBuilder!

Best regards

 
Sunday, 13 May 2018 15:52 UTC
hugovandrunen
Hi

I don't think it is a bug in Beaver Builder, it´s the way a visual editor works.
In the editor everything is shown a visual as possible, the nearest to the final result.
Then you can point to a certain block (module) and open the editor (Text Editor, Image, HTML, etc) of only that part, see the text or code corresponding to that block, and edit it. The HTML module where we put [wbamp-show start] we can open and edit. Normally what you put in a module is entirely within that module, a text, an image. But the shortcode [wbamp-show start] says: from now on don´t show anything until I tell you otherwise. And that's what happens. The shortcode not only takes effect within the module, but also on on other modules, apparently in the same row.

I think in your shortcode you can have a conditional, that looks if we are in editing mode, and in that case does not hide, but shows the literal shortcode instead.

The show/hide feature is an essential tool for building pages with Amp and No-Amp.
Common users, when adding Amp to their sites, and seeing their modules going away in the editor, will probably not blame their existing plugins and theme, but rather get rid of the new AMP plugin they are trying.

I can work with the workaround I told you (temporary [wbamp-show start][wbamp-show end]), but I don't think my clients will use it.
See also my ticket #78, this is a follow-up.

Best regards
Hugo

Monday, 14 May 2018 08:23 UTC
wb_weeblrpress
Hi

I don't think it is a bug in Beaver Builder, it´s the way a visual editor works.
Which I would tend to agree with and why I call it a bug in BeaverBuilder because it should not do that at all.
In the editor everything is shown a visual as possible, the nearest to the final result.

Absolutely, but even in that case, that should not affect the content stored. The latter really is a bug.

But the shortcode [wbamp-show start] says: from now on don´t show anything until I tell you otherwise. And that's what happens. The shortcode not only takes effect within the module, but also on on other modules, apparently in the same row.
Which is why it's a bug in BB, because that behavior is not triggered by weeblrAMP. The decision on what to store in the database (and thus what will come back when you try to view the content a second time) is up to BB, not weeblrAMP. We do not have any impact on that in any way - and should not, that's how all shortcodes work in the WP world.

Best regards

 
Monday, 14 May 2018 10:17 UTC
wb_weeblrpress
Hi

After looking into this a bit more, I came to the same conclusion as you (ie, people will blame us) so I have added a filter for BeaverBuilder to prevent the removal of weeblrAMP shortcodes. That fixes the issue for me so far. Let me know...

Best regards

PS: you can download that new version from the development versions download area

 
Wednesday, 16 May 2018 15:51 UTC
hugovandrunen
Hi

I have tested your development version, and the show / hide issue with Beaver Builder is solved.
It works fine.

Thank you, best regards
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.