0

I'm in the process of designing a browser based system that will allow non-technical users to quickly and easily change the content of certain parts of a web page via a WYSIWYG template-based drag-and-drop editor. Essentially, the user can choose from a few prepared templates, drop some image files into predefined areas within the template, edit some text or links in predefined areas, and the result will be reflected on the actual website.

I have a simple prototype of the editor interface written in Polymer, which works great so far. I am now trying to figure out the best way to save the results of this server-side, and produce the final static HTML output based on it. I'm pretty keen on keeping Polymer client-side, as the interface is rather complex and dynamic and more traditional pure-Javascript approaches can get very messy very quickly.

However, including the same Polymer templates client-side is not feasible I think; I'll need to produce compact, no-Javascript, highly compatible pure HTML output.

The obvious solution would be to prepare two parts to the same template: an editable Polymer version which results in some blob of attributes being stored on the server (e.g. template: 1, placeholder1: imageXYZ, placeholder2: "Foobar", etc.), coupled with some server-side rendering process which takes this data and produces the final HTML output. The problem is that this requires two versions of the same HTML template to be kept in sync.

Another solution may be to produce some meta-template from which both an editable version and the rendered result can be produced programmatically; this approach seems to be very complex though, possibly too complex for the scope of this project.

Are there any other well known approaches for dealing with this problem, or well defined meta-template libraries/systems/approaches that will work well in my scenario? Or will I simply have to bite the bullet and accept the redundancy as part of the task?

1 Answer 1

1

place the blanc templates on the server, you client(s) download them and respond with a certain configuration for it, keeping a lot of clients in sync and maybe with problems in their template (bugs etc) might cause more problems, on (i assume php) server do a format check when updating.

Ik you keep it all in templates, there is even no need for static HTML, but then you need some kind of MysQL backend to generate Page(x) that used template(y) which had picture links collection, and data block collections etc...

BTW all lot of such programs do exist and they are called content management systems.

2
  • I don't think using Polymer client-side is the best choice here; I want to produce static HTML output, without requiring all users to download the Polymer library and a bunch of external assets. I've clarified my question in this regard. Also, I haven't found any existing CMS that will do that to a level of quality I need. I basically want Squarespace's admin; can you recommend anything open-source that works so beautifully?
    – deceze
    Commented Jan 15, 2015 at 0:22
  • Maybe you create some kind of macro language, so whenyou push something to the server, server reads and included within that push gets the template as well, severside then php can creates a page.
    – user613326
    Commented Jan 16, 2015 at 15:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.