Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Templating issues I had #2962

Closed
dschmid opened this issue Dec 31, 2018 · 3 comments
Closed

Templating issues I had #2962

dschmid opened this issue Dec 31, 2018 · 3 comments
Milestone

Comments

@dschmid
Copy link

dschmid commented Dec 31, 2018

I tried to create a template for Orchard core. I started with disabling JQuery and Bootstrap. Instead of JQuery I would want to use Vue.js (http://vuejs.org) and instead of Bootstrap I decided to use Bulma (http://bulma.io). Here are just some difficulties I had to fight with:

  • Over all Orchard seems to be too much Bootstrap centric. Forms, for instance, are very difficult to leverage without bootstrap. There apparently are many

    's and many attributes generated solely for satisfying the needs of bootstrap. I would wish Orchard core to be less dependent on the presentation framework or that I have some more pointers to documentation on how to create 'neutral' Templates. I think a possibility could be to use Orchard in a decoupled way. Do I have to chose that way?

  • Fluid seems to hide Razor. The documentation seems to favor Liquid and the example themes/templates are written with Liquid. As far as I can see, Liquid is useful to create templates on the fly within the admin UI. I don't really understand the preference for Liquid templates within the Blog and Agency themes. For me it does seem like an additional layer of difficulty, including the loss of IntelliSense. I would wish some more advices to leverage 'pure' Razor syntax.

Am I the only one observing those problems? How would the best way be to get arround those?

@pgy866
Copy link

pgy866 commented Dec 31, 2018

If the UI framework can reduce dependencies or be easy to separate, that's wonderful.

@sebastienros
Copy link
Member

1- Bootstrap centric

The main issue is that when a content item is rendered using a theme, even if a theme only contains a layout we need to render something for each part and field. It requires some balance between being able to render something that looks good and something that is not dependent on any class/tagging. For the TitlePart for instance it's easy, we just need an <h1> tag. For a form element however, the size of the field, the label location and style, checkboxes, all these will depend on the framework we use. And because the default rendered html is targeting bootstrap, it looks fine when your theme also uses bootstrap, or you have to override all the form elements to define a new template that matches your framework. Now let's assume we are way less opinionated and render framework-agnostic html. Forms elements will look nicer than before, but will probably not match your tagging either and you will still need to create custom templates for each element.

I assume you understand the dilemma here, but I with we could do something better. For instance maybe we could use some pretty standard tagging, with custom classes that could be used to customize it, while at the same time provide a set of templates that are framework specific, that devs could use when starting new templates. This means that for TheBlogTheme which is based on Bootstrap, we would have to copy these sample templates in the theme. We could then have the same ones for Bulma or Foundation. And it would also have a file for the Flow grid. It's like having base theme for each framework, though copy-pasting the templates is also a good solution.

2- Fluid vs Razor

Fluid is a necessary solution for admin-side templates., no discussion. Razor is "my" preferred solution for file-based templates, but several users have given the feedback that they prefer Liquid for these too, either because it's easier for designers, or because it lets them use the same language everywhere. I prefer Razor because I get intellisense, and it's easier for me to write custom code. Also it's faster because it's compiled instead of being interpreted.

I assume the issue here is that all front-end templates that ship OOB are on Liquid. blame @jtkech for that ;) How it happened is that Liquid has been added as an option for the the file based templates, then to validate it TheBlogTheme was converted to liquid, then TheComingSoon was created using the same basis by another contributor. So it's not really a project preference but mainly based on each contribution.

What do you suggest here? Duplicate all themes in both Razor and Liquid such that there is no actual preference at the project level?

@sebastienros sebastienros added this to the backlog milestone Dec 31, 2018
@dschmid
Copy link
Author

dschmid commented Jan 2, 2019 via email

@OrchardCMS OrchardCMS locked and limited conversation to collaborators Apr 25, 2024
@Piedone Piedone converted this issue into discussion #15836 Apr 25, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants