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. React fragment code#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. React fragment full#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 |