Site logo

Archived topic

single page application

8 replies · Started by david on July 8, 2021

Viewing posts 1–9 of 9

Hi, I'm interested in making a SPA application in WordPress, I'd like to make a gallery app and like the idea of just using the anchor tag (#) to change the image being displayed without reloading the page. The idea seems simple enough, but compared to building a normal WordPress site it seems to be a very complex process and I'm not sure it's worth learning all this to make the browsing process a little more smooth/responsive.
So my question is, is this the only way to make a SPA app in WordPress? Maybe WordPress is not suitable for building single page applications?
Like to hear what you think, and if there's an alternative way to do this within wordpress

Thanks

Hi David,

If you require a SPA-like behavior for your page, that'll mean all the loading involves AJAX requests.

You'll need a gallery plugin that sends AJAX requests on a click of a button to request a new image that replaces the current image.

This is complex and yeah AJAX is the only way to go since you have a specific requirement of not reloading the page. :D

Hi Elvin, Thanks for clarifying. I assume trying to integrate it with wordpress just adds another level of complexity to an already complex process.

After much Googling came across WPGatsby / WPGraphQL seems like this might be the the way to go.
Any thoughts?

Hi there,

Gatsby and GraphQL will allow you to create a SPA - but its not going to do the hardwork which is creating the React/JS Components for displaying your content - that would still be required and would require custom development.

Thanks David,
I'm trying to get my head around React, I like the logic and feel this is the future for web development.
I'm familiar with the WordPress environment, and hopefully I can concentrate on coding in React without worrying if everything I need is in place.
I assume I can't add WordPress pages or posts to this site. Can you suggest any good tutorials about developing with Gatsby within WordPress?
Is GeneratePress and GPpremium suitable for developing React apps in WordPress?

Thanks

Information direct from Gatsbyjs can be found here:

https://www.gatsbyjs.com/guides/wordpress/

Which contains a link to the WP + Gatsby Documentation. And should assist with the decision whether you should integrate with GP, there isn't anything that GP does that would stop you from doing so.

Or alternatively take a look Freecodecamp i believe they have some tutorials on WP + React.

And if you want to learn React then check out the course by Wes Bos.

Hi,
Making progress, think Frontity is what I'm looking for ...till the next big thing.
For Wordpress I'll use the GP theme and for the Frontity SAP I'll stick with their Mars theme - does that make sense?
Thanks for your time.

Sounds like a good solution !

This archived topic is closed to new replies.