fragmenta / fragmenta-cms

A user-friendly CMS written in Go (golang)
http://fragmenta.eu
MIT License
586 stars 70 forks source link

Runtime editable templates feature discussion #47

Open ghost opened 6 years ago

ghost commented 6 years ago

I was wondering if the templates themselves can be editted in the web GUI as part of an admin section.

My usecase is to allow Designers to create and control the templates. They use the existing datamodels available. I think it might be possible to lookup the data binding so the user can see possible data fields based on the templates context also. On the right they can see the final result as they edit the template. In short it's very similar to a markdown editor.

I think that this would also make it much easier for golang developers to make templates since you have instant feedback.

The exact approach for setting up the context of the databinding I am not sure about yet. For instance maybe the user would select a table in the database and use that as a context. Not sure yet.

The other thing is that the templates are added, editted and deleted at runtime. So these would have to live stored someone. The file system seems the most sensible

What do we think about this ?

kennygrant commented 6 years ago

It would be quite possible, but I'd rather avoid it, having seen things like that done in Drupal etc. and the mess that can be made with them - I think it's best to avoid blurring the line too much between code (developers) and content (users).

Approaches that other systems take:

The current approach is of course: