PayPal addon

Permalink
I installed the PayPal donation addon. How do I have the Paypal page open in a new window?

 
JohntheFish replied on at Permalink Reply
JohntheFish
For any page to open in a new window, code the links that point to it to include target="_new" in the <a> tag.

<a href="http://www.anywhere.com/anypage" target="_new">See anypage from anywhere</a>


How you get this into the html depends on how you are creating a link. From any block with an html view it is just simply editing the text.
ttianna replied on at Permalink Reply
How do I get to the HTML? I add the PayPal add on through the wizard in the dark chocolate theme. I'm not sure how to see/edit my page's HTML.
JohntheFish replied on at Permalink Reply
JohntheFish
That all depends on what type of block you are using to add the link to the payment page.

Have you added the link using the regular 'Content' block? Or is it in an autonav block? or what?

Or do you want your part of the payment (the paypal addon) page to stay in your window, but to open PayPal's part of the payment process in a new window?
ttianna replied on at Permalink Reply 1 Attachment
I choose "Add to Main" and then choose "Add Block" and then "PayPal Donations Block". It's an addin I downloaded from the market. I would like the donations page to open in a new tab or window. I attached a screenshot. So, when the user clicks the image, that launches the PayPal payment page. Right now it opens in the same window. I would like the payment page to open in a new window. There doesn't seem to be an option for that in the wizard, but if I could modify the HTML, I could customize that - I just don't know how to access the HTML, edit it, and get it back onto my site.
Thanks for your help.
JohntheFish replied on at Permalink Reply
JohntheFish
You will need to create a new view template for the PayPal block

Copy the file:
packages/paypal_donations_box/blocks/paypal_donations_box/view.php

To:
blocks/paypal_donations_box/templates/donate_new_window.php

Then edit line 10 (the form) to:
<form action="<?php  echo $controller->paypal_url?>" method="post" target="_new">


Now when in edit mode, select your PayPal donations block, click 'Custom Template' and select 'Donate New Window'.
ttianna replied on at Permalink Reply
How/where do I copy the files and edit them? I only know how to access the wysiwyg.
JohntheFish replied on at Permalink Reply
JohntheFish
To implement the above, I think you need to someone who can sit down with you and explain about file systems, text editing and ftp. We are getting too far back to basics to do this by remote control through a forum.

Here is a completely different solution. Below your paypal block, create an HTML block and paste exactly the following into it. ANY MORE OR ANY LESS AND YOU RISK BREAKING YOUR SYSTEM IN SUCH A WAY THAT YOU WILL NOT BE ABLE TO RECOVER IT (and I will not be able to help you or accept responsibility).
<script type="text/javascript">
if (CCM_EDIT_MODE){
document.write('<p>SCRIPT TO OPEN PAYPAL IN NEW WINDOW</p>');
}else{
$(document).ready(function(){
$('div.block-paypal-donations').find('form').attr('target','_new');
});
}
</script>
JohntheFish replied on at Permalink Reply
JohntheFish
I have just discovered that the above can prevent you from editing the PayPal block. If so, you will need to delete the html block containing the script, edit the PayPal block, then create the html block with the script again.
(there is probably a better way to do it, but I don't have time to sort it out)