You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering if anyone has tried to integrate Templ components into a WYSIWIG editor - a use case would be content editors could create CMS Pages, for example creating an article page which renders styled .templ components such as a text area, image, heading, etc.
You can create have a private endpoint on your go server, for example, POST https://localhost/component which returns dynamic html based on component name, and parameters e.g TextContent from the request body.
This would return the rendered Article heading component HTML in a response, ready to be placed into the WYSIWIG editor.
What would be the drawbacks to this approach, the best practices IF you were to take on such an approach, and are there any tools in either the standard templ library features or WYSIWIG editors to make this integration more straightforward?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm wondering if anyone has tried to integrate Templ components into a WYSIWIG editor - a use case would be content editors could create CMS Pages, for example creating an article page which renders styled .templ components such as a text area, image, heading, etc.
You can create have a private endpoint on your go server, for example,
POST https://localhost/component
which returns dynamic html based on component name, and parameters e.g TextContent from the request body.This would return the rendered Article heading component HTML in a response, ready to be placed into the WYSIWIG editor.
What would be the drawbacks to this approach, the best practices IF you were to take on such an approach, and are there any tools in either the standard templ library features or WYSIWIG editors to make this integration more straightforward?
Beta Was this translation helpful? Give feedback.
All reactions