I have struggled with this several hours now.
Backdrop seems to edit code for paypal buttons except the first one so that they don't work.
Code is added in 'raw' format and all html 'fixes' are disabled - why does backdrop change this code?
I thought raw meant raw.
For some reason the older paypal buttons work fine. The problem is that new ones are needed for credit card payments on smartphones
This is the page: https://bd.buddhistisksamfund.dk/butik
Comments
Hi Egmund...,
From my experience raw, change your text/code unless you have filters applied to the text format.
It looks like your page content is inside the PayPal form...
Edit your text "source" and make sure you don't have any code inside the Paypal code/form
Hi Egmund, can you post the original code and tell which part exactly gets removed?
(To post the original code, you use the "Insert code block" button of the editor.)
This is orig. code. Backdrop removes the form action and insert an end-form later (or move it down).
<div><style>.pp-VTRXBASDR9YR8{text-align:center;border:none;border-radius:1.5rem;min-width:11.625rem;padding:0 2rem;height:2.625rem;font-weight:bold;background-color:#FFD140;color:#000000;font-family:"Helvetica Neue",Arial,sans-serif;font-size:1rem;line-height:1.25rem;cursor:pointer;}</style><form action="https://www.paypal.com/ncp/payment/VTRXBASDR9YR8" method="post" target="_blank" style="display:inline-grid;justify-items:center;align-content:start;gap:0.5rem;"><input class="pp-VTRXBASDR9YR8" type="submit" value="Køb nu" /><img src=https://www.paypalobjects.com/images/Debit_Credit_APM.svg alt="cards" /><section style="font-size: 0.75rem;"> Leveret af <img src="https://www.paypalobjects.com/paypal-ui/logos/svg/paypal-wordmark-color.svg" alt="paypal" style="height:0.875rem;vertical-align:middle;"/></section></form></div>I have though removed the faulty parts of page and am playing with paragraphs and custom blocks, but see no way to sort paragraphs.
Sorry, couldn't wait
Make sure that ckeditor or tinymce is not enabled for that filter. Especially ckeditor is opinionated and will change the html.
I have tried ckeditor tinymce and 'nothing' - same results, code get messed up. Something is 'fixing' and instead messing up.
If there is no way to have actually raw html in BackdropCMS then I can no longer recommend it.
Hi Egmund,
BackdropCMS tries hard to output valid markup, by default even the "raw" format.
Your code is invalid, though, as there's a
<style>tag inside the body, whereas those tags are only allowed in html<head>elements.If you really want that markup as-is, go to admin/config/content/formats/full_html and disable all filters, especially the "Correct faulty and chopped off HTML" one.
You can't use any WYSIWYG editor with markup like that, of course. And you should make sure, that really only admins can use an unfiltered format like that, as turning all filters off is quite dangerous.
I have tried that as well - no difference. Code get messed up anyway.
And - my style tags are needed in order for the page to look fine no matter what width the display is (style clear-both) - and this works just fine.
I have solved the problem by having multiple text fields on the page. I can then separate content and seems to work - all my buttons now work. But this should not be necessary.
Hm, this works for me. I've set up a new text format (at admin/config/content/formats) without any Filter and without Text editor. Then, I've added a page, switched to the new format, pasted your code, and saved the page.
Backdrop didn't change anything with two exceptions, but those should be okay:
Yes Olaf,
Works in most cases, but not with what was in the field originally (sorry, that is now deleted).
I think it was very similar to this, and the paypal code was added at the end:
<div style="clear:both;"><hr><img alt="Rinzai Roku" data-align="left" data-file-id="35" height="431" src="/files/inline-images/rinzairoku.jpg" width="287"><p><br>Rinzai Roku er nu oversat til dansk</p><p>Flot bog 26x18,5 cm Indbundet, 80 sider.</p><p>Denne er med en DVD med lydoptagelser fra teishoer optaget under sesshin gennem de sidste ti år med Choan Roshis udlægning af teksten. Ca. 70 timelange lydfiler - næsten 900mb mp3 filer.</p><p>Det er også muligt at få filerne på USB-stik eller få adgang til filerne på vores server. Lad os vide.</p><p>Pris kr. 1.200,- plus forsendelse kr. 55,-</p>Thank you all for the quick help - or trying to.
And I apologize for not properly documenting this seeming flaw in Backdrop. I was too eager to find a work-around (cannot have a non-working shop).