UPDATE - I have confirmed that the formatting of my source url in frontity.settings.js is creating an issue with how the Wordpress menu is fetched. localhost:8888/folder/ creates an issue where https://somesite.com doesnāt. It seems the when I use an location with a subfolder, the urls get /folder as the start of their pathsā¦but short of altering the urls that get generated in the map function of nav.js, I canāt figure out how to address this. Below is my initial postā¦
I am excited to use Frontity and have really appreciated the videos and documentation! I hope someone in this community can help me figure out how the ālinkā and ārouteā get built/defined, because I think thatās where things are going wrong. Sorry I keep editing, but Iām trying to add info and things Iām tryingā¦The problem Iām having after fetching my wordpress menu is that the route and link each resolve to ā/newsg/pageā instead of ā/pageā so only the index page at locahost:3000/ loads properly - any other link clicked on in the navigation results in a ā404 - Not Foundā error because they each resolve to localhost:3000/newsg/somepage instead of localhost:3000/somepage ā if I delete the /newsg/ part of the url in the address bar, the page loads perfectly.
I donāt really understand enough of how things are working to know if the problem is the actually the route. The source url in my frontity.settings.js file is āhttp://localhost:8888/newsgā which is the directory of my wordpress site. So that is where I am guessing the /newsg is coming from. But I donāt know if somewhere along the line frontity internally does string replacement to have the source url map to localhost:3000/ and Iāve made a mistake somewhere that is interfering with that? (I got thinking along those lines after reading this post Fix/internal links multiple sites by nicholasio Ā· Pull Request #625 Ā· frontity/frontity Ā· GitHub) I also noticed that in the video, Michael is using a subdomain for his project (wp-menu.test/) instead of (wp-menu/test/) and I wonder if making my wp site a subdomain would help this complication? As a shortgap solution, Iāve added the following to my nav.js, which works but imho is a pretty janky solution:
{items.map((item) => {
**item.url = item.url.replace('/newsg', '');**
if (!item.child_items) {
Here is a repo of the files: https://github.com/chrisvwlc/frontity.git
And, if I understand correctly, the āWP REST API urlā is http://localhost:8888/newsg/wp-json/menus/v1/menus/primary.
Thank you for your time and thoughts.
Here is a screenshot showing the error as well as the link and routeā¦
as well as a page loading if I remove the /newsg