-
Notifications
You must be signed in to change notification settings - Fork 790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resource Locator API not documented #851
Comments
I'll add resource locator to the list of things to document. Cheers. |
The reason for adding the docs or adding
For example:
// Check if a template exists for the given data
$template = 'structured-data/json-ld/' . $key . '/' . $key . '.json.twig';
if ($locator->findResource('templates://' . $template, true, false) === false) {
continue;
}
$this->grav['twig']->processTemplate($template);
[...] |
You don't need a stream for this, the easier solution is just this:
|
I've checked, but your solution does not work. The
vs
Additionally the locator checks if the file also exists on the disk. I could also write code to deal with this case, but well... that is what the locator is used for. And it would make most sense to add the code |
The issue is that with the current logic it's almost impossible to keep |
I dont understand. For me the suggested patch works. |
As stated in this forum post The Resource Locator is not documented anywhere. The Forum Post is the only useful hit available via google and the link to the API is dead now. I found the source here
Especially I'd like to know which other alias exist like
user-data://
etc. I'd need to look for the location of a template.Edit: Is it possible that there is no
templates://
resource? Is it possible to add such a resource that looks into all templates provides by all plugins and theme? I've written a patch.The text was updated successfully, but these errors were encountered: