DRYest approach to “rendering” drag-and-drop template editor results to HTML

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?

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

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật