I’m working on a website with a “stream” of the Project-Space Theme by @OleVik.
I like the theme a lot and find the clean URLs very helpful, especially when you can list the filtered categories in the address. This is super handy !
But unfortunately it’s only working on the published website and not in local DDEV development. I’m super noob with NGINX… and I don’t even know if the problem comes from there…
So basically when I click on “APPLY”, nothing happens in the URL, the page reloads slightly (as in a fade effect), and I get the following error in the Mozilla dev console : 403 Forbidden
Does anybody have an idea of where I should dig and debug ?
@medi, I’ve just installed the skeleton of Project-Space in a subdirectory of my localhost: http://localhost/grav/site-space. The home page (/projects) displays correctly, but when setting filters and running ‘Apply’ it throws an error in the console. It redirects to http://localhost/projects, which doesn’t exist.
Also the urls in the menu on the right side of the page point to the root of the site: http://localhost
Thanks @pamtbaau !
Actually now that you’ve tested it, (and specifically when you mention the “/project” redirection) I noticed that there’s something to do with my website architecture.
I’ve commented out this in the tools.html.twig file, to see if it works manually :
Thanks a lot for your hint !
Apparently the FILTER part doesn’t recognize the format in the url. And I also want to make it look more readable.
I’m still looking for a way to make it work.
@medi, When I install the skeleton inside the root of one of my virtual hosts (e.g. http://dev-dev) on my localhost, the theme works fine. Both the filtering and the menu.
The URL-setup is for the quite generic variant of a server-setup, as you’ve noticed for the production-server. It’s been a while since I ran DDEV, but what you’re noticing in tools.html.twig#L33-37 is done to ensure that “the page reloads slightly (as in a fade effect)” - otherwise known as PJAX (pushState + AJAX) - as intended. Navigation does actually occur, but it is obscured through animations.
I gather, from your tests, that the theme works at the root of a domain, but not in a subfolder with NGINX? I can’t see the same problem with LiteSpeed (Apache) in testing. Would you care to share more details of the NGINX/virtual host setups?
Running Apply throws an error in the console pjax.min.js:1 GET http://localhost/projects/category:Idea 404 (Not Found). Also because no relative urls is being used.
The theme words fine when running in the root of a domain.
I’m sorry but I’m really a beginner in this topic. I’m just using the .conf file provided in the Grav package (by copying it to the Nginx-server folder of the ddev hidden folder). It’s been working well for all the functionalities of Grav and basic theme manipulations. Basically 99% of my needs.
Indeed it is, I am in the process of updating it for 1.7-compliance. The issue may actually have arisen from how Core’s API treats the generation of the Base URL. It’s why tools.html.twig#L33-37 is needed, otherwise the theme is blissfully unaware of how to do the AJAXified redirects.
In other themes I’m fairly sure I have found workarounds, so it’s possible here too. Just requires some time for testing alternatives.
Indeed, the loss backwards-compatibility with a major-version-bump. v2.0.0 proper includes fallbacks to empty arrays if categories, tags, or colors are not set.