You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have started on this and got it all cloned down locally to investigate. It looks like the members site uses a version of CiviCRM to handle the donations, ive requested access to the member's site in slack.
Will see if its possible to use the existing functionality, if not we can possibly do this using the T51 donations plugin, but will try and leverage what they already have if possible.
I've had a brief look at this and there's two main things to address here. One is the page templates, the other is donation handling.
Page Templates - In order to add a donation widget in a sidebar we'll need to update page templates to include a sidebar. The only page with a sidebar at the moment is the blog archive page. Do we know which post types or pages will have the donation widget? Also, based on the mock-ups, the width of the sidebar is greater than on the blog page, so this would need some different styling applied. I think the best approach here would be to register a new widget area specifically for the pages where we want it to appear. This would make it easier to add/change whatever donation solution is implemented. Never mind, I just read the Zendesk ticket which is very specific on the page and location. I'll start looking into a solution for this.
Donation handling - as mentioned above, the members site uses CiviCRM for the donations, among other things. It would probably make sense to use the same solution here, though we would probably need to install the plugin and connect it up. It seems like overkill, though I'm not familiar enough with the plugin/platform. Another option could be the Team 51 Donations plugin - which would also require WooCommerce, WooCommerce Subscriptions, and a hookup to potential gateways. There's also other standalone donation plugins, all of which also require connections to payment gateways. Is there a preferred route we're looking to go here?
For donation handling, we should really make an effort to use Civi, ideally through its API. We need to find a way to build a donation form that uses the Civi installation we have on members.opensource.org. @ajolo2ky can you please loop in Bryan to address this?
opensource.org and members.opensource.org are connected through Civi, so I think the easiest way is to create a new Contributions Page and develop a quick plugin to fetch its HTML code through the API, but let's wait and see what Brian has to say.
I realized there's a simple option to allow embedding Contribute Forms from Civi elsewhere. Here's a quick example: https://registro.nerdear.la/civijs.php
This is the javascript provided by Civi:
<!-- The stylesheet link is optional and can be removed
if you want to style the form yourself, or if you
already are including a bootstrap css environment. -->
<link rel="stylesheet" property="stylesheet" href="https://members.opensource.org/wp-content/civicustom/ext/net.ourpowerbase.remoteform/remoteform.css">
<link rel="stylesheet" property="stylesheet" href="https://members.opensource.org/wp-content/civicustom/ext/net.ourpowerbase.remoteform/spin.css">
<div id="remoteForm"></div>
<script src="https://members.opensource.org/wp-content/civicustom/ext/net.ourpowerbase.remoteform/remoteform.js"></script>
<!-- Extra JavaScript URLs, if any: ... -->
<script> var remoteFormConfig = {
url: "https://members.opensource.org/civicrm/remoteform/",
id: 7,
entity: "ContributionPage",
// Uncomment line below for test mode,
// paymentTestMode: true,
// Extra JavaScript Params, if any: ...
};
if (typeof remoteForm !== "function") {
document.getElementById("remoteForm").innerHTML = "Oh no! I was not able to display the form! Please check your security settings (for example Privacy Badger) and allow remote javascript to be displayed from members.opensource.org."
document.getElementById("remoteForm").style.color = "red";
}
else {
remoteForm(remoteFormConfig);
}
</script>
I've added the staging website in our CORS policy. Could you please try it and let me know if it works.
Then we'll have to do some visual touches for it to look good, but let's first try to see if this is technically viable.
On Fri, May 10, 2024 at 3:10 AM Ariel Jolo ***@***.***> wrote:
I realized there's a simple option to allow embedding Contribute Forms
from Civi elsewhere. Here's a quick example:
https://registro.nerdear.la/civijs.php
This is the javascript provided by Civi:
`
<script src="
https://members.opensource.org/wp-content/civicustom/ext/net.ourpowerbase.remoteform/remoteform.js"></script>
<script> var remoteFormConfig = { url: "
https://members.opensource.org/civicrm/remoteform/", id: 7, entity:
"ContributionPage", // Uncomment line below for test mode, //
paymentTestMode: true, // Extra JavaScript Params, if any: ... }; if
(typeof remoteForm !== "function") {
document.getElementById("remoteForm").innerHTML = "Oh no! I was not able to
display the form! Please check your security settings (for example Privacy
Badger) and allow remote javascript to be displayed from
members.opensource.org."
document.getElementById("remoteForm").style.color = "red"; } else {
remoteForm(remoteFormConfig); } </script>`
I've added the staging website in our CORS policy. Could you please try it
and let me know if it works.
Then we'll have to do some visual touches for it to look good, but let's
first try to see if this is technically viable.
Thanks,
—
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKJJAEGV6EXFQUVKPVV6W3ZBQNB7AVCNFSM6AAAAABG2U3TP2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBTGY3TGOBWGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
I've made a first go at adding a sidebar widget area called "License Sidebar" (in Appearance > Widgets) and pasted in the script above. I've un-commented the test mode attribute. Sample page here, though any license will show it.
The good news is it works, and we can probably use this as the way forward. The bad/tricky part is the styling of the form. I'm not sure why, but it seems the script provided by Civi is just a generic one with the correct form ID. I say that because I was expecting the same form element selectors and styling/stylesheet, but it's not the case. Even if I link the relevant stylesheets from members.opensource.org nothing happens because of the missing selectors on the form elements.
Can we find out if it's possible to also pull the form element selectors the same way it renders on the members site?
from what I understand remote form intentionally breaks from the Civi styling to present a more stripped down markup because the assumption is that the site where you are embedding the form will have it's own styling that you would want to match. in other words, you would adjust the styling on your target website so have the embedded form match.
re: form element selectors specifically -- all of the form elements have unique IDs, so they should be easily selectable.
@ajolo2ky@smaffulli
I've been poking around a bit more with this and looking at options. I should be able to style the remote form to get close to the members site with one major exception - the recurring donation. As far as I can tell, the remote form extension doesn't support recurring donations. If that's not an issue, then I'll work on styling the remote form.
If recurring donations are a must, then we can consider alternatives such as a basic link to redirect users to members.opensource.org/donate/, potentially with pre-populated selections, other donation plugin/form options outside of civiCRM, or potentially a custom solution through the civiCRM API (I haven't looked into this option yet, and what is possible here).
@nickpagz sorry for the delay following up on this. The page you linked to previously doesn't appear to have the form anymore. Can you setup a new test page that includes the remoteform js and we can troubleshoot there before adding it to the "real" page? We should be using form ID 19, and I've made one change at my end to address a possible issue. But I'll need something setup for testing at your end to try to troubleshoot the CORs issue further.
I'm bypassing my script (osiFormInit) for now as this was causing a 500 response, and is really only being used for styling/layout changes. With it out of the way you should be able to now see the CORS issue in the console.
If/when we resolve that issue I can jump back in and try to resolve the issues with my script.
Hi, I added it and it's working, thanks. Minor fix (test in stg and then we move to prod):
Could you separate a little more the body of the license and the sidebar ? ideally the donation box would fit visually right below the OSI approved license logo
@ajolo2ky My apologies for the delay! I've now merged the change to the production site, though it looks like the donation widget code is commented out. If/when the code is reactivated and you notice any issues, please let me know.
Hi, yes, just responded in the thread over email. Thanks for pushing this. Let's close the issue as we need to implement some internal processes before enabling this again.
Activity
gin0115 commentedon Apr 29, 2024
Have started on this and got it all cloned down locally to investigate. It looks like the members site uses a version of CiviCRM to handle the donations, ive requested access to the member's site in slack.
Will see if its possible to use the existing functionality, if not we can possibly do this using the T51 donations plugin, but will try and leverage what they already have if possible.
xpurichan commentedon May 1, 2024
👋 Wanted to confirm that you received the access you needed @gin0115 . Let me know!
gin0115 commentedon May 1, 2024
Hey
Sadly i was told its not something i can work on as its not held in Team51 Repos, so its been added back to the triage queue, sorry @xpurichan
xpurichan commentedon May 1, 2024
No worries, thanks for confirming @gin0115 ! I see this will be re-assigned out next week.
nickpagz commentedon May 8, 2024
I've had a brief look at this and there's two main things to address here. One is the page templates, the other is donation handling.
Do we know which post types or pages will have the donation widget? Also, based on the mock-ups, the width of the sidebar is greater than on the blog page, so this would need some different styling applied. I think the best approach here would be to register a new widget area specifically for the pages where we want it to appear. This would make it easier to add/change whatever donation solution is implemented.Never mind, I just read the Zendesk ticket which is very specific on the page and location. I'll start looking into a solution for this.smaffulli commentedon May 8, 2024
Glad to read you sorted out 1.
For donation handling, we should really make an effort to use Civi, ideally through its API. We need to find a way to build a donation form that uses the Civi installation we have on members.opensource.org. @ajolo2ky can you please loop in Bryan to address this?
ajolo2ky commentedon May 8, 2024
Sure. I've created ticket #7880 for him.
opensource.org and members.opensource.org are connected through Civi, so I think the easiest way is to create a new Contributions Page and develop a quick plugin to fetch its HTML code through the API, but let's wait and see what Brian has to say.
ajolo2ky commentedon May 10, 2024
I realized there's a simple option to allow embedding Contribute Forms from Civi elsewhere. Here's a quick example: https://registro.nerdear.la/civijs.php
This is the javascript provided by Civi:
I've added the staging website in our CORS policy. Could you please try it and let me know if it works.
Then we'll have to do some visual touches for it to look good, but let's first try to see if this is technically viable.
Thanks,
smaffulli commentedon May 10, 2024
nickpagz commentedon May 11, 2024
I've made a first go at adding a sidebar widget area called "License Sidebar" (in Appearance > Widgets) and pasted in the script above. I've un-commented the test mode attribute. Sample page here, though any license will show it.
The good news is it works, and we can probably use this as the way forward. The bad/tricky part is the styling of the form. I'm not sure why, but it seems the script provided by Civi is just a generic one with the correct form ID. I say that because I was expecting the same form element selectors and styling/stylesheet, but it's not the case. Even if I link the relevant stylesheets from
members.opensource.orgnothing happens because of the missing selectors on the form elements.Can we find out if it's possible to also pull the form element selectors the same way it renders on the members site?
ajolo2ky commentedon May 13, 2024
Thanks for testing it out! I've reached out our Civi developer to see if he can help us with the styling.
ajolo2ky commentedon May 13, 2024
@nickpagz this is his response:
from what I understand remote form intentionally breaks from the Civi styling to present a more stripped down markup because the assumption is that the site where you are embedding the form will have it's own styling that you would want to match. in other words, you would adjust the styling on your target website so have the embedded form match.
re: form element selectors specifically -- all of the form elements have unique IDs, so they should be easily selectable.
nickpagz commentedon May 14, 2024
Ok, let me see what I can do.
nickpagz commentedon May 20, 2024
@ajolo2ky @smaffulli
I've been poking around a bit more with this and looking at options. I should be able to style the remote form to get close to the members site with one major exception - the recurring donation. As far as I can tell, the remote form extension doesn't support recurring donations. If that's not an issue, then I'll work on styling the remote form.
If recurring donations are a must, then we can consider alternatives such as a basic link to redirect users to
members.opensource.org/donate/, potentially with pre-populated selections, other donation plugin/form options outside of civiCRM, or potentially a custom solution through the civiCRM API (I haven't looked into this option yet, and what is possible here).Looking forward to your thoughts.
ajolo2ky commentedon May 20, 2024
Let's get this started, if in the next three months we get a good flow of donations we will consider expanding the functionality. Please move forward!
Thanks,
7 remaining items
lcdservices commentedon Jul 18, 2024
@nickpagz sorry for the delay following up on this. The page you linked to previously doesn't appear to have the form anymore. Can you setup a new test page that includes the remoteform js and we can troubleshoot there before adding it to the "real" page? We should be using form ID 19, and I've made one change at my end to address a possible issue. But I'll need something setup for testing at your end to try to troubleshoot the CORs issue further.
nickpagz commentedon Jul 31, 2024
@lcdservices My turn to apologize on the delay here! It looks like another PR wiped out the changes I had made to the theme, but I've added them back now. You should now be able to see the form here:
https://open-source-initiative-development.mystagingwebsite.com/license/artistic-1-0
I'm bypassing my script (
osiFormInit) for now as this was causing a 500 response, and is really only being used for styling/layout changes. With it out of the way you should be able to now see the CORS issue in the console.If/when we resolve that issue I can jump back in and try to resolve the issues with my script.
ajolo2ky commentedon Aug 30, 2024
Hi, after all the back and forth we decided to go with a much simpler choice. I integrated a Stripe card and it's now working in stg:
https://open-source-initiative-development.mystagingwebsite.com/license/w3c
Could you please promote the license template with the sidebar to production ?
nickpagz commentedon Sep 3, 2024
Thanks @ajolo2ky I'll get the PR cleaned up and pushed out this week.
nickpagz commentedon Sep 9, 2024
@ajolo2ky The license sidebar template is now live on production. You can add the Stripe donation code to it now.
Please let me know if you run into any issues.
ajolo2ky commentedon Sep 12, 2024
Hi, I added it and it's working, thanks. Minor fix (test in stg and then we move to prod):
Could you separate a little more the body of the license and the sidebar ? ideally the donation box would fit visually right below the OSI approved license logo
nickpagz commentedon Sep 16, 2024
Sure thing! Let me see what I can do.
nickpagz commentedon Sep 17, 2024
@ajolo2ky I've made the adjustment on the staging site. Let me know what you think.
wpspecialprojects commentedon Oct 16, 2024
@ajolo2ky checking to make sure you saw this thread
ajolo2ky commentedon Oct 25, 2024
Thanks for the nudge. Looks good, please promote it to prod.
toncijajic commentedon Oct 25, 2024
@nickpagz noting the above.
nickpagz commentedon Nov 20, 2024
@ajolo2ky My apologies for the delay! I've now merged the change to the production site, though it looks like the donation widget code is commented out. If/when the code is reactivated and you notice any issues, please let me know.
toncijajic commentedon Nov 26, 2024
@nickpagz noting I've pinged @ajolo2ky in the email too, to move this forward.
ajolo2ky commentedon Nov 26, 2024
Hi, yes, just responded in the thread over email. Thanks for pushing this. Let's close the issue as we need to implement some internal processes before enabling this again.