Is there any way to add CMS to Nextjs website (such as Wordpress)? - wordpress

I developed a website using Nextjs (Client side only, and used Nextjs for the SEO).
I wanted to ask if there is a way to convert this website somehow from Nextjs to Wordpress or anything else, or even somehow connect it to CMS application, so my client can modify images and content any time he want by his own.
Currently, the web application in Nextjs is pretty static, all the pages and conntent are hard coded wroten.
All my data are in JSON files and such are the images in the website.

Yes! This is a pretty hot topic right now, and there are many ways to accomplish it.
Here are the general guidelines:
Set up a "headless CMS" - this can be WordPress (set up in a special way so you are using just the backend) - or there are many other popular options, such as Contentful, Sanity, Prismic...
Your CMS needs to have an API for Next.js to use. If you go with WordPress, you can use the built-in REST API - or you can use the WP GraphQL plugin
This is such a popular topic, that if you search around, you'll find many helpful guides that go into more detail. You'll want to search "Next.JS with WordPress headless CMS"
Here's one example I found that uses GraphQL and looks fairly thorough.
Or, if you're not set on WordPress, check out Next.js-specific information for other popular headless CMS's - most of them will have specific documentation and guides for Next.JS - for example Sanity's Next.JS Guides.
WordPress is solid and flexible - but if you're not already a fairly strong WP developer, then I might recommend going with one of the more pre-packaged options (like Sanity, Prismic, Contentful, etc.) - many of them have a free tier.

Related

Mixing Wordpress eCommerce site with external login based Vue Frontend Best Practices

I am new to web development and and would like advice about what is the usual best practices to achieve what I am trying to do.
I am in charge of writing a frontend app using Vue. This frontend will require a login to access the app. The app will be hosted on Amazon.
However we are also wanting to build an eCommerce site in Wordpress or equivalent that sits on the root of the website, (eg www.mywebsite.com) with the app accessible through a "sign in" button. If the user presses the sign in button we want the location bar location to not change from the website they are on (www.mywebsite.com), even though the Wordpress site and Vue frontend may be stored on different locations/domains.
If the site is made in Wordpress, we can get another developer to do that webpage for us, while I work on the frontend. However we want the experience to be relatively seamless between connecting to the wordpress root site, clicking on the sign in button and being taken to the Vue frontend.
Is this possible? Do both sites have to be hosted on the same server for it to work (eg an Amazon EC2 server which hosts two webpages, the wordpress one and the vue one)?
Or can the wordpress put a link to the Vue frontend which doesn't change the web location to the user?
Or (worst case scenario) do we need to make both webpages in Vue as one Vue application, some pages requiring login to access and others not?
Thanks kindly for any assistance.
So in order to use Vue and WordPress together, you can either write 2 separate applications. One for the Frontend and one for the Backend, which is perfectly fine or you can simply write a WordPress Application with a Vue Theme.
This is how this could look like:
WordPress Backend
You can use a normal WordPress backend, where you can build the architecture you want to. In addition, you need to set up the REST-API Wordpress provides. So this also means, just use plugins which support it. Otherwise, you would need to write custom endpoints. For example, Woocommerce would be a good e-commerce plugin, since it supports the API.
Learn more about it here: https://v2.wp-api.org/
Of course, you can host your WordPress installation on Amazon. Here is a good guide for that: https://aws.amazon.com/de/getting-started/tutorials/launch-a-wordpress-website/
Notice: The REST-API is available in core since 4.7. If you are using an older version you would need to install a plugin.
WordPress Frontend
In order to create your Frontend, I'd recommend you to make a custom theme. Since you are just serving static files this can be done pretty easy. But still, you don't need to reinvent the wheel.
There's a really good starter theme out there: https://github.com/EvanAgee/vuejs-wordpress-theme-starter
It comes with all the stuff you need to get started and since it is just a theme, you can simply set up a usual WordPress hosting without handling Domains of multiple applications.
In order to get the data from the Backend, you would simply make calls to the REST-API. Here's an example: https://github.com/EvanAgee/vuejs-wordpress-theme-starter/blob/master/src/api/index.js

ezpublish backend pushing to wordpress frontend

I have this problem that our primary news site is already running on wordpress. Due to the editorial workflows and some new projects, i am checking ezpublish. But I want to keep wordpress frontend and want to attach it to ezpublush. So content that gets generated in ezpub can be published live into wordpress. I find extensions are very limited so wondering has anything been worked upon this direction.
If you really want to keep on using Wordpress for your frontend, what about using the REST API to retrieve content from its content repository ?
The REST API provided by the eZ Engineering is just awesome so most of your work will be to develop something on the Wordpress side which will be able to get connected to this API (I don't know WP enough to say if it's something easy or not).
Another solution if you don't want to use the REST API, is to use an XML template in place of the default HTML one. This way, eZ Publish will expose its contents over XML which is more usable than pure HTML...
Pro for the REST API : very fast (in comparison of using the XML solution)
Cons for the REST API : need to develop something dedicated to this WP/eZ bridge on the WP side
Pro for the XML solution : maybe more simple since I'm pretty sure that there are some extension on the WP side which are able to import contents based on XML
Cons : see REST API's Pro
Sorry if it's obvious, but I'd suggest that you do an estimate of moving the design and content to ez so as to establish how much work you can afford to sink into this push idea.
I think that you should look at the workflow support in ez and the onpublish trigger. This will let you hook the content as it's being published in ez and push into wp. The model is going to have some edge cases since the content structure in ez is quite flexible. For example, you're going to need to make some choices about related content, embedded content and images.
The easiest option would be to configure an rss export from eZ and import that rss into WP objects. However I agree with Doug that you would be best using this as a temporary solution with the plan being to replace the Wordpress front end with an eZ front end.

codeigniter with wordpress

I am planning a new website with codeigniter using wordpress.
this site will contain creating online albums, selling presents and gifts, and another one for selling cameras and their accessories.
is it recommended using this combination?
what are the advantages and disadvantage of this?
is there a better solution for building with framework and cms?
Personally (Having experience of both) It all depends on what your objectives are. Are you wanting to quickly and easily pull the project together, or do you have unlimited time and want everything to be feature rich and customized to your exact specification? CodeIgniter will allow you to build each aspect exactly as you want, where as WordPress (through the use of plugins) will allow you to get the end result you want without quiet as much customization.
However, that being said there is nothing saying you can't use CodeIgniter and direct traffic to the WordPress part for certain aspects, all down to your personal preference.
Why did you decided to use a working cms and a php framework together? Just using one of both is enough. The advantage you will have with wordpress is the fact that there are many plugins that are easily to use. For Codeigniter you will have to do all of the codings for yourself but you can build your website like you want it to be!

Which CMS should I use when I hand a website over to my non-techie friend?

I'm designing a simple website for a friend - four static pages to advertise a yoga retreat she is running. I have a couple of requirements:
My time is short; I want to quickly build a theme template.
She has no technical skills; she wants to log in to the backend and update page content.
Working for myself, a static site builder such as nanoc or jekyll would be ideal: I can build a template.html with room for some content, then update content files, rebuild the site and redeploy. As a bonus, the whole site could be hosted free on GitHub pages. This satisfies requirement (1) but not requirement (2).
I've also considered Wordpress, because I've got plenty of experience running WP sites and developing custom themes. This satisfies requirement (2) but not (1). There is simply too much development overhead building a WP theme - it is not straightforward to modify the markup structure of all those template files, and there are plenty of snags involving ugly page titles or "Comments are disabled" strings which need to be removed.
It shouldn't be this difficult. I want a site engine which has a simple template.html file for easy re-theming, and an accessible backend for content changes. Bonus points if free hosting is available somewhere.
Perch - http://www.grabaperch.com - is made for this sort of thing, though it's not free (£).
Could you hack a site together using tumblr pages?
What about Google Sites? Dead simple.
If you're open to .NET i think you should look at n2cms.
WordPress using a premium theme bought in any of the many sites offering quite nice themes for a reasonable price (60 USD). Then, you just change the logo and ready to go.
Since I'm not a web designer myself, this is what I´ve done myself for my sites and I´m quite happy with the results

What is the use of Wordpress APIs?

I saw in wordpress some APIs being published for developers. What could a developer gain by using those APIs?
I think you've taken API to mean something similar to what Flickr and Vimeo do, which they are not. They are simply ways for you to access and ammend core functionality of the Wordpress platform, so as to bend it to do what ever it is you need it to do.
There are ways to pull data from your blog to a mobile devise, but that is a very different question.
Wordpress API are for those that want to develop a theme, or writing custom plugins for Wordpress.
Either way, you can use to integrate Wordpress in your exisiting php site, using the powerful backend as an administration tool and the using the API to retrieve the content and present it in your (already) website.
http://codex.wordpress.org/Integrating_WordPress_with_Your_Website

Resources