Is it possible to add additional form fields to the ghost membership page and/or profile so I can more easily integrate with another site? I effectively want to collect a username for another site to give additional access on that site. (Using email is not sufficient.)
Option 1 - fork the Ghost core. Not really a good option, since then youâd have to keep up with updates and could only self-host (although maybe thatâs not a problem).
Option 2 - create a subscription form that includes the extra data you need, as a page within Ghost [HTML cards, most likely], with some extra javascript to handle the submission. When the user clicks the submit button, youâll have an event listener (overriding the normal form submit), that both posts to the members api to create the member (you can see whatâs required by using dev tools in the browser) AND also to another endpoint, not within Ghost. That could be a webhook, or a droplet running an api, a Google form, orâŚ
Hi, thanks for your explanation.
How can I implement that?
Thanks for answering,
kind regards
Barry
If you can ask a specific question, Iâll be glad to try to help you, but if you want a step-by-step-what-buttons-to-click, thatâs beyond the free time I have tonight. The documentation for event listeners in javascript is here: EventTarget.addEventListener() - Web APIs | MDN
Youâre also going to need to read about fetch (or axios).
Youâll need to set up some service listening for those fetch POSTs and recording that theyâve happened. And youâll need to make the request to the Ghost API to send the magic link also.
None of those steps is particularly difficult if you have intermediate-level javascript, but if you need to ask what an event listener, this may be a bigger project than youâre looking for.
Cathy
Thanks again!
This might be a bit too much indeed. As a temp. Workaround, can I change destination url of the subscription button ? I like the button as it is, but I require some extra input from subscribers. I have a great form on another website (Wordpress) so redirecting there would be greatâŚ
Regards,
Barry
You can certainly change the destination of a form (that isnât Portal) on your site. Without knowing what your site is or what âsubscriptionâ button you refer to, thatâs all I can offer. (If youâre talking about the Portal pop-over window, thatâs not user editable. But you can turn it off and cause a button to take users to some other form.)
Remember that if you send subscriptions to some other site, youâll need to somehow sync between that other site and Ghost, if there are subscriber features on Ghost that you want your members to have access to.
I should have been more precise, but I managed to fix it. I created an alternative form on a new page. Then I set subscription to |ânobody|â. That makes the original button dissapear. Then I created a new button with CSS that floats at the bottom, just like the original subscription button. In code injection I copied the code so it shows on all pages. I linked the button to my new subscription form: tadaaaâŚworks well. Have a look:
Thanks for the help. Kind regards,
Barry