medusa-ui/medusa

Improve local fragments

Closed this issue · 0 comments

Currently we load fragments like this:

<th:block m:fragment="self#darkmode"></th:block>

I would prefer it if we could get rid of the # and have

<m:fragment service="self" ref="darkmode"></m:fragment>

and default fragment-service to self, so for local fragments you'd get

<m:fragment ref="darkmode"></m:fragment>

Additionally, I want the fragment-ref + service to be something that can be dynamic (ie controller controlled). So it should resolve spel expressions/basic thymeleaf ${} interpretation. That way it should be easy to create an overall template, then load in different pages into the one template.