Skip to content
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

separate settings for source and target directory #7

Closed
ghost opened this issue Oct 11, 2011 · 5 comments
Closed

separate settings for source and target directory #7

ghost opened this issue Oct 11, 2011 · 5 comments

Comments

@ghost
Copy link

ghost commented Oct 11, 2011

Source images does not have to be accessible from web root. There are some use cases when it is not desirable.

E.g. we could have HQ photos and only show medium-sized, watermarked photos.

@LouTerrailloune
Copy link
Contributor

You can implement this with a custom DataLoader.
I did this, and add a prefix to my images path. The loader translate the prefix from the image path to an absolute path.

Adding a global source path might be interesting, but in my case I have many source paths, and this will require a parameter in the twig filter.

@ghost
Copy link
Author

ghost commented Oct 12, 2011

You can implement this with a custom DataLoader.

Of course, but what I think is the correct way is the configuration option.

 I did this, and add a prefix to my images path. The loader translate the prefix from the image path to an absolute path.

 Adding a global source path might be interesting, but in my case I have many source paths, and this will require a parameter in the twig filter.

Keep in mind that in your example you can also use symbolic links within one, dedicated source directory.

@lsmith77
Copy link
Contributor

lsmith77 commented Nov 5, 2011

i have just made custom data loaders a lot more flexible by allowing per filter set data loaders. the main reason for this is to prevent users from having to create data loaders that can handle multiple data sources.

at any rate if you need to do this, i would suggest you simply redefine the file system loader with a different root path. note i also just renamed the "webRoot" property to "rootPath" in the file system loader to make clear we just care to get a base path.

@lsmith77
Copy link
Contributor

lsmith77 commented Nov 5, 2011

just to further explain this: i don't want to add data loader specific configuration options in order to keep things more focused. creating a custom service isn't so hard and its config only as the code is ready to handle your use case.

@ghost
Copy link
Author

ghost commented Nov 5, 2011

Sure. No problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants