-
Notifications
You must be signed in to change notification settings - Fork 495
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
Add attributes after replace #716
Comments
This is the expected behaviour of In order to do a merge operation like the one you need, you'd have to do something more specific, like for example: <div th:fragment="testFrag(classapp)" class="default-class" th:classappend="${classapp}">
Hello World!
</div> And then: <div th:replace="/test/fragments :: testFrag ('append-me')"></div> |
This would mean that one would have to define a parameter for any attributes to add on the replaced fragment. Is there a way to do something like a merge or would that require a custom dialect? |
Is there any update on the question of @NielsNet? It would be really nice to replace fragments and keep the attributes. |
Have been asked to look at this issue by Code Triage. |
is there any update on this th:replacewithattr ? @danielfernandez |
Currently (Thymeleaf 3.0.0) there does not seem to be a way to add attributes to a tag that is replaced.
E.g. when having a fragment called
testFrag
in a file/test/fragments
:and using this:
I'd expect the following:
However, the actual output is
I was wondering if I just missed out a way to do this with standard thymeleaf or if it might be a planned feature.
The text was updated successfully, but these errors were encountered: