craft3-templateselect icon indicating copy to clipboard operation
craft3-templateselect copied to clipboard

Template path issue on Windows with Laravel Valet

Open ipetrov87 opened this issue 6 years ago • 3 comments

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:

matrix field configuration

First I notice that I get the absolute path in the field when I am in the entry instead just the stripped filenames:

used in entry

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:

loading the template

So I am on Windows 10 and using vitr/valet4windows

ipetrov87 avatar Jun 08 '18 16:06 ipetrov87

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.

sjelfull avatar Jun 08 '18 18:06 sjelfull

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.

ipetrov87 avatar Jun 09 '18 07:06 ipetrov87

Made a patch for it at #7 Works on both windows and linux

okolvik-avento avatar Apr 05 '19 14:04 okolvik-avento