craft3-templateselect
craft3-templateselect copied to clipboard
Template path issue on Windows with Laravel Valet
I am trying to use the extension for one of the project that I just start to work. The idea is to put template select field in a matrix field and select a template for each matrix component. So here is the configuration of the matrix field:
First I notice that I get the absolute path in the field when I am in the entry instead just the stripped filenames:
I was think that this is some strange bug that will not affect me when I used it in the template. But I was wrong. When i try to open the page in the browser i get this:
So I am on Windows 10 and using vitr/valet4windows
Problem is I don't use Windows and doesn't have access to a Windows machine to test this either. I'm open to Pull requests, though.
It is all about the DIRECTORY_SEPARATOR. In Windows it returns ** and my path was entered with /. So that`s why I see the entire path and not just the file name. It will be annoying to change all my paths every time when I move it on Linux server.
Made a patch for it at #7 Works on both windows and linux