Integrating XML SOAP data into a theme

Hello,

I built a website for my ISP company using Ghost. I have a decent understanding of theming in Ghost Handlebars, but not so good when it comes to delving deeper into node. We are a reseller of DSL internet from our big national ISP and they provide us with an API to access their network. The API is called their B2B XML Gateway. What we want to do with the gateway is allow a visitor to enter their address and query the National ISP using the API to determine what service options are available…

So my concept is to built a .hbs template file to access the API using SOAP XML but I don’t know how. Before I really waste my time learning something that may not be possible, I would like some feedback on my concept.

Hi @mikegcox :wave:
Sounds like you’re wanting to build a fairly custom application. I’d recommend keeping what you have in Ghost and then build this part with something else. That way you’ve got a separation of concerns, and don’t have to modify the Ghost install you have. It might work well on it’s own subdomain with a JavaScript framework that can interface with the API.

Just my suggestion, but this would be the approach I would take :slight_smile:

My idea is to just do the work in the theme and not touch the core. I don’t want to have a separate site for this, but I may have to I suppose. The theming seems pretty powerful in Ghost. For example I made a template that has a signup form and I use that template on service plan pages. Right now that form is just uses Basin (website form handler) but I am thinking I could expand that concept into accessing the API.

Well if that works for you then go for it!

You’ll be able to grab external API information within your Ghost theme using client-side JavaScript :slight_smile:

Yes, that is what I have decided to do. I will have a web service that gets the data from the API converts to to JSON and then I will display the results on my site using javascript in the theme.

1 Like