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

How to use layouts without mvc #761

Open
AhmadAlMunajjed opened this issue Feb 23, 2025 · 6 comments
Open

How to use layouts without mvc #761

AhmadAlMunajjed opened this issue Feb 23, 2025 · 6 comments

Comments

@AhmadAlMunajjed
Copy link

Hi fluid team, thanks for this project

I am building website builder project using liquid template engine

in the project I want to support having themes, I am thinking of storing and fetch theme files in/from git/cloud files storage
a theme might have structure as follow:

  • themes: liquid files
  • templates: liquid files
  • locales: json file

can I implement this using fluid?
do you suggest any caching strategy (in memory for example) or does fluid cache files internally?

Thanks

@hishamco
Copy link
Collaborator

Have a look at the sample Fluid.MinimalApisSample

do you suggest any caching strategy (in memory for example) or does fluid cache files internally?

What caching that you are refer to?

@AhmadAlMunajjed
Copy link
Author

Thanks!
I mean caching liquid files in memory after or before parsing it

@AhmadAlMunajjed
Copy link
Author

For the provided example in Fluid.MinimalApisSample
All files in Views, can I put the files in different directory? or get it from external source?

@hishamco
Copy link
Collaborator

hishamco commented Feb 23, 2025

All files in Views, can I put the files in different directory? or get it from external source?

Yes you can, please check these lines

options.PartialsFileProvider = new FileProviderMapper(webHostEnvironment.ContentRootFileProvider, "Views");
options.ViewsFileProvider = new FileProviderMapper(webHostEnvironment.ContentRootFileProvider, "Views");

I mean caching liquid files in memory after or before parsing it

I'm not sure why you need to cache all the files, we already have some expensive liquid in Orchard Core, but I will let @sebastienros answer this part

@AhmadAlMunajjed
Copy link
Author

AhmadAlMunajjed commented Feb 23, 2025

Appreciate your help @hishamco

What I am trying to figure out is, how to build website engine that serves different tenants/themes. each theme has set of liquid files and files are stored in external source such as cloud storage.
I am planning to cache the published theme files to improve performance of loading the page because fetching these files over http cost is very high.

Have you done similar approaches in Orchard Core?
It would be really helpful and appreciated if you could introduce a better approach

@hishamco
Copy link
Collaborator

We already use Liquid in Orchard Core, but we usually cache the expensive liquid code, for example, generating the main menu, which is fit in this case

I don't there is anything that prevents you from caching the views, but if you want to store your views in an external source database or anything you want you might need to tweak the view engine IMHO

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