Hello Frontity Community!!!
I am very new with using frontity and just installed the npx package with mars theme, currently reading the docs and getting familiar with the frontity environment.
is it possible to connect frontity into a localhost WordPress with using MAMP to access localhost WP Dashboard?
I am used to using MAMP with apache, myphp developing themes with WordPress.
I really like the idea of not using .php with Frontity, but im curious if I could link the WP localhost dashboard using MAMP with frontity to design and develop a theme. can anyone explain and shed a light with this?
Hi, you can set your local installation of WP as the data source.
Update frontity.settings.js:
This will pull the data from your local site.
Note: you will need to handle this via environmental variables if you decide to deploy the Frontity theme to production, otherwise it will still link to your local when deployed.
Woah! i just made it work! I set the api to http://localhost:8888/wp/wp-json since my MAMP is set to localhost:8000. This is HUGE!
As I read through frontity docs, you can add more themes on frontity’s packages folder.
Is it possible to add the frontity theme for example the mars-theme to wp-admin/theme?
also, based on the mars-theme, the menu items/navigation items are stored in frontity.settings.js. is it possible to include a react-router-dom or even create a full react app and add it as a frontity theme?
As I read through frontity docs, you can add more themes on frontity’s packages folder.
I don’t think you can make your Frontity theme show up in the WP dashboard. Frontity theme lives on a completely different server and makes the theme decoupled from WP.
is it possible to include a react-router-dom or even create a full react app and add it as a frontity theme?
I haven’t tried to include react-router to Frontity. Have a look at the build in router. It does make sure that all slugs from your Wordpress are available as routes in Frontity.
I haven’t tried to include react-router to Frontity. Have a look at the build in router. It does make sure that all slugs from your Wordpress are available as routes in Frontity.
with the builtin router,@frontity/tiny-router, is it possible to make the menu items dynamic as if when you add/remove/edit/delete a new page, it will show up dynamically on Frontity’s localhost:3000?
Another Question: What if I have created multiple themes under my packages folder, which will be set into their individual domains? what would be the best approach to handle that?
or,I guess I am asking if is it possible to designate a custom theme(s) into individual domain/site?
Also, what if I have of couple of custom favicon.ico on different themes? is it possible to have different favicons set on themes for one Frontity project?
Frontity delegates the logic in packages, so each package is responsible of a specific task. @frontity/tiny-router is the package in charge of managing the routes in a Frontity project (in the client side)
Regarding the menus, as long as you have the info of the menus in the REST API you should be able to read that information dynamically from your Frontity App and generate a custom menĂş based on that data.
i’ve tried http://localhost/wp-json and http://localhost/wp/wp-json and none of them work and i’ve copied the url for localhost directly from my web browser.
MAMP settings are apache port 80, nginx port 80, mysql port 8889.
Its been a number of years since i’ve used MAMP so I wouldn’t be surprised if i’m missing something obvious.
I tried this and it doesn’t seem to be working. I copied and pasted the url from the wordpress site http://localhost/ directly from my browser. Does frontity have to be in the wordpress theme folder? is that what i’m missing?
No you have to understand that Wordpress and Frontity are 2 differents entities ,they don’t need each other to work.In fact Frontity does not care how you run your wordpress since it only works with rest api. I’ve worked on few Frontity projects without even knowing how wordpress is configured on the server side or if it was running mamp, wamp or whatever.
Frontity needs your wordpress url mostly to retrieve data from the wp rest api and that’s how they communicate.
What exactly is going on ? Does Frontity throw an error ? If not what’s happening ? The base url of your Wp is localhost ?
Update: I figured it out. it was a silly mistake on my part. I had renamed the folder for frontity and I didn’t refresh my code editor so while I was sitting there making changes to the file it wasn’t actually changing anything. I reloaded my editor and made the change and it works perfectly fine.