Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Adding html <form> </form> tags in content editor


Go to End


14 Posts   5018 Views

Avatar
servalman

Community Member, 211 Posts

30 November 2009 at 11:00pm

Hello Everyone

I have to add those lines of code to some page in a silverstripe based website :

It is a paypal page but when I try to add in the HTML editor using the "tinymce_advcode" window it does not work because it does not save it. Do you know where I can find information about that ?

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="10028136">
<input type="image" src="https://www.paypal.com/fr_FR/FR/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - la solution de paiement en ligne la plus simple et la plus sécurisée !">
<img alt="" border="0" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1">
</form>

Thanks a lot for any help

Avatar
Double-A-Ron

Community Member, 607 Posts

30 November 2009 at 11:42pm

This is TinyMCE filters doing their thing for security. There are quite a few posts about on this but basically you need to customize the javascript that does this validation.

This thread is probably most inline with what you are trying to do. Check out the moxicode link near the bottom of the first page.
http://www.silverstripe.org/archive/show/202803#post202803

Aaron

Avatar
servalman

Community Member, 211 Posts

1 December 2009 at 3:39am

Hello Thanks for the answer

It seems to be what I did need but I'm unable to find "tinymce.template.js"

Can you tell me

Thank you

Avatar
Double-A-Ron

Community Member, 607 Posts

1 December 2009 at 11:11am

Hmm, seems alot has changed with both Tiny and SS since those posts were published. My apologies. That file doesn't exist anymore.

If you look in /cms/code/LeftAndMain.php, around line 175, you will find the valid_elements and extended_valid_elements declarations. You could just replace one of those with the full XHTML list shown on that moxiecode list.

Aaron

Avatar
servalman

Community Member, 211 Posts

1 December 2009 at 9:17pm

Thank you

I had found it by myself.

I think I'm going to make a post later this week about that matter because thing's are clear now and I have the feeling that I was not the only one who had this problem.

Thank's very much for your help

T

Avatar
Double-A-Ron

Community Member, 607 Posts

1 December 2009 at 10:47pm

I think I'm going to make a post later this week about that matter because thing's are clear now and I have the feeling that I was not the only one who had this problem. 

Yeah good idea. I wasn't aware it had changed so much myself.

Aaron

Avatar
Mountbracken

Community Member, 1 Post

9 December 2009 at 12:53pm

So, did this end up working for the original poster? I was trying to add a paypal form to a clients website, and tried the same thing (adding the full XML list from the moxie site to the leftandmain.php file, but it's still stripping out my form elements. Are there other settings that need to be changed as well?

Avatar
servalman

Community Member, 211 Posts

9 December 2009 at 8:57pm

Hi

Yes it worked with the basic paypal form [the one with no multiple choice] but I'm trying to add a mutiple choice form but it is not working because the tags <option> and <select> are iignored and I don't get why .

I edited LeftandMain.php the same way I did for forms but with no sucess .

I'm a bit stucked now and so is my client

Hope I'll find out .

But for the basic paypal form it works :

- Edit the LeftandMain.php
- Add the tags in the valid element list
- Flush

T

Go to Top