![]() ![]() We are constantly adding new configuration types to the configuration Schema, but developers still need to adapt their needs to existing configurations. On the other hand, we can easily find some customization limitations when writing more complex configuration files. On the one hand, a fragment configuration can be defined just by writing a JSON file without extra work, and we can take care of all the form rendering and configuration management as needed. On the other hand, fragments have a more limited configuration with a restricted structure, allowing us to render customized configuration fields for each configuration type. Widget configuration panels can contain anything using a JSP file, leaving all freedom and work to Widget developers. ConfigurationĪlthough Fragments and Widgets have configuration panels, their rendering process is different. That's why we decided to expose some extra variables (like fragmentNamespace) so users could use it as a tool when creating them. In the first draft, using FreeMarker to process fragments was a hidden functionality that we needed to use to find editables, but after some time we found that using FreeMarker in HTML was useful (for example using loops to create some dynamic markup). By adding a new data-lfr-editable-id and -type attributes, developers could mark some arbitrary HTML elements as editable without needing extra markup. There were still some situations where using an lfr-editable tag was good enough, so we decided to come up with some extra solution that could live with the existing tag. In both the FrontEnd ( edit mode) and BackEnd ( view mode), we were processing it as FreeMarker code to generate the final HTML with all editable values replaced.Īfter some time, we discovered that combining the new lfr-editable tag with CSS was a bit painful: in view mode we were replacing this tag with a div tag, having different HTML markups in edit and view modes and breaking CSS styles. We chose this syntax because it is valid HTML markup and developers could continue using their editors to create fragments. In the beginning, we added a new lfr-editable HTML tag which allowed a type attribute which type of editable will be used. As Fragments are focused on content display we need some tool that allows defining what we called "editable fields", parts of the HTML markup that can be manipulated by end-users (aka marketers) so they can quickly create Content Pages without relying on external resources. In this post, I pretend to sharpen those lines and highlight the differences between them.Įditable fields are probably the main difference between Fragments and Widgets. This doesn't mean that we have altered the original concept, they still can be used as simple pieces, but we might have blurred the line between them and Widgets, as some of their functionality overlaps. They have become much more customizable and complex, and they provide lots of new features. But we know that today that definition is full of exceptions: fragments also have JSON configuration files, they can be rendered with Freemarker or even generated with a Java class. ![]() That was, more or less, the first definition we gave when we started the Modern Site Building project. Fragments are simple, are just some pieces of HTML, CSS and JavaScript that can be added to a page and easily managed by FrontEnd developers.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |