Message Boards

Making it easier to add a web content template

Lee Jordan, modified 3 Years ago.

Making it easier to add a web content template

Expert Posts: 449 Join Date: 5/26/15 Recent Posts
It breaks my heart that in seeking to improve WEM ... web content was barely touched. Yet a few tweaks can make a huge difference like the portlet drop zone highlighting on drag ... huge, brilliant, long overdue.

For quite a long time now I've seen our users struggle to find how to add web content to a WCD. What our users don't do that Liferay engineers seem to do is add content via Content Web Content. No no that's too many steps. Nobody is going to write their content in the control panel off the site page then click on "Select Web Content" on the page. Mostly because half the time elastic search doesn't work, so you can't find the web content created, bleh. So simply that doesn't work and it's too much work anyway to go create web content in one area, then come back to the page then search for it and blah blah. It's too much to explain and understand. This approach is a disaster in the new content pages also, it's worse there.


Content > Web Content > Add New Content then Add a WCD to the page then load up a modal and search for your content ... Go here, now go there, now go back there then go there ... too hard.


Our users would use the very easy "plus button" in the portlet topper on the page (not the one in Content > Web Content). Clicking it lists the web structures available. You select which one you want and fill out the form and hit publish. It's cognitively easier. However it's not clear, it's tiny and therefore overlooked. I'm actually having a private bet with myself that this icon will be removed at some-point which would be a total misstep to do such a thing.

But most new users struggle to find the plus button we talk of (you have to hover over the portlet to see the icon).What we need here we can keep "select web content" .... but what we need is "Select Template" as well (given that it's too hard to do it the liferay way users found their own much easier way so let's embrace that). 

Therefore a simple suggestion I've screen-shotted ... add a button in the blank WCD that says "Select Template". Clicking this would then either activate the drop down or display a modal with a list of structures to select from. Boom, instant progress.
thumbnail
David H Nebinger, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Legend Posts: 14919 Join Date: 9/2/06 Recent Posts
Actually it is probably best to consider web content and the WCD widget as deprecated.

Most of the effort now is going into improving content pages, page fragments and the like.

Overall the whole experience is simply better for all involved, the web developer, the web designer and the business user will all benefit from adopting the modern site building experience.

To learn more about modern site building, I'd encourage you to take the free course from Liferay University: https://university.liferay.com/modern-site-building


It will show you how each of the 3 different roles benefit from the new approach, and this also will help to resolve many of the UX issues you're seeing with WCD.
thumbnail
Christoph Rabel, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
Actually it is probably best to consider web content and the WCD widget as deprecated.

Ugh, I would not phrase it that way. That would be really bad. Those two types of content (fragment and webcontent based) serve different purposes. Fragments serve best for "static" content pages but webcontent shines for dynamic content. Latest news, upcoming events, filtered by topic, menu of the day, ...
There is also content that is best created using a form. I mean, give the user input fields, he enters some content or selects some things and something renders the item and enforces the look and feel. We found that the freedom of fragments can be overwhelming for certain user groups. They don't want to place stuff on a page and rearrange it.
Then mobile and desktop: It is hard to provide images optimized for mobile devices with fragments. It's simply tricky. (There are feature requests open for that, but I think they will only start with it in 7.4). There are other mobile issues too, sometimes you want to rearrange stuff and it is again tricky if css is not sufficient.
I also understand where Lee comes from. His users are used to add structured content. They feel comfortable with it. And I can perfectly understand that. As I said, some users don't want to edit pages.
And then the permission thing: Some companies don't want to grant the all content editors the permission to create/update/delete pages. Adding webcontent, with a workflow or something, is more convenient.
Since both webcontent and fragment content have their merits, both should live on and grow better.
thumbnail
Jorge Ferrer, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Legend Posts: 2871 Join Date: 8/31/06 Recent Posts
Hey David,

Sorry to correct you here but I think it's important to make very clear that Web Content is not deprecated. In fact it is still considered very important to the present and future of Liferay's WEM features

A more accurate story is that Liferay used to be strongly content-oriented (content first, publication/display second) which is a great fit for some use cases. However for some other use cases, it's very cumbersome (and Lee gives a good example of that in his initial post). In the last few releases we have invested a lot in making Liferay's WEM much better at being page-oriented (display first, content created within/from the display). But of course, there are still many use cases where the content is created first and is later used by a different group of people or even by external Apps via Headless APIs. We still consider those use cases very valid and we plan to continue to invest in web content.I also believe that being a great content-oriented WCM and a great page-oriented WCM are not things that are at odds with each other, but rather complement and reinforce each other. That's the direction we are going.

Also, widget pages and WCD in particular are also not deprecated. There is a possibility that they would be superceded in the future, but only if there are better solutions in place for all the use cases for which they are the best fit. While I believe that there are fewer cases where Widget Pages would be a better fit than fragment-based pages since 7.2, there are still some and for those it's not only fine, but recommended to use them.
thumbnail
Christoph Rabel, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
Since nobody commented on the actual feature request:
I like it! It should be easy to create/update webcontent on a page using a WCD. If you create a feature request and link it here, Lee, I will vote for it.
thumbnail
Jorge Ferrer, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Legend Posts: 2871 Join Date: 8/31/06 Recent Posts
We have added a feature with takes some steps in this direction for 7.3 (which is included in GA5 BTW). There is a new type of page called "Collection Page" which has the goal of facilitating the very common pattern of creating a page to publish a collection. Functionally it's the same as creating a widget or content page and placing an Asset Publisher widget or Collection Display fragment. The key difference, other than making it easier (a big deal for non technical users) is that the system knows that the page is tied to the collection and that allows offering certain additional capabilities on top. One of the first that we are adding is a + icon in the control menu (the bar at the top) to be able to add new items to the collection.
We also want to add something similar for any "secondary" collection on the page, but we would like to find a way to avoid showing that control in view mode because a frequent complain we get right now (with widget pages) is that controls in view mode have different types of negative consequences with how the page looks (for example, CSS is applied differently for users with some controls). The alternative we are thinking it to leverage the new page "Content Edit" mode where a right panel will list all the collections on the page. While it requires more clicks than what Lee suggests, that also puts the control out of the way for the most common scenario of just viewing the page just like any regular user would. 
What do you think?
thumbnail
Christoph Rabel, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
I had no time to look into GA5, but I will soon and check that feature out.
I am not sure how this relates to Lees request, he isn't talking about collections of webcontent. He just wants to add one of them and quickly.
I think, for most usecases a single collection would be sufficient, but I am not sure if a dedicated page for lists is really necessary and why it is necessary. Just for the ADD button in the top bar? In that case I would rather like to have an "Add article button widget" that I could freely place and style (and with a configuration to specify nice defaults, structure, template, categories, ...)
I fully understand the edit/css issues with the portlets, we have encountered them too.
If I understand correctly, the button for adding items to the collection is somewhere in the top bar (probably right corner). That won't work for at least one of our customers. Several groups of editors NEVER see that bar. They just have the add and edit buttons for webcontent available, nothing more.
That's actually not that uncommon and we did that quite often. A lot of our customers did not want to bother normal users or "lesser" editors with pages, content management, and especially that top bar + product menu.
To work around the issues we most often added our own buttons. We simply implemented the add and edit buttons in freemarker and styled/placed them where we wanted them in the asset publisher. This was very convenient from a frontend perspective since we could place the buttons wherever we want. It was more of a challenge from the backend and permission perspective. While the standard asset publisher template provides some macros, it still was a bit of a hassle to implement it in some usecase since the necessary information was not trivially available.
thumbnail
Krzysztof Gołębiowski, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Master Posts: 549 Join Date: 6/25/11 Recent Posts
I haven't had a time to play with GA5 yet, but so far on our GA4 microsite, we managed to build all static pages using Content Pages while all dynamic pages still are driven by Asset Publishers. The editors are really happy with this approach as they don't need to use Web Content Display portlet to create static pages, which was the most not intuitive action they were forced to do in 6.2/7.0. They understand though the concept of dynamic page and agree with adding a new piece of Web Content for this case.
The only issue I see here, which initially does not look very serious but becomes a problem when the portal grows, is the organization of dynamically added web content in the back end. Usually, we create folders for different types of web content, so it is more or less organized when using the Control Panel. If the editor adds a new dynamic web content using the Asset Publisher (and they really like to do that), it is saved in the main folder which, after a few years, results in an unorganized list of thousands of articles. There are ways to fix it like workflow or model listener, but I think this deserves its own configuration on the widget level.
thumbnail
Jorge Ferrer, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Legend Posts: 2871 Join Date: 8/31/06 Recent Posts
Hey Krzysztof,
Thanks for the feedback,  I'm glad to hear that you are successfully using Content Pages for the static pages. When you use Asset Publishers, do you use widget pages or content pages? Why?

BTW, have you tried the new Collection Display fragment? While it still doesn't have all of the features of Asset Publisher, such as pagination, I'd love to hear your feedback and particularly what you are missing the most to be able to leverage them.
Regarding creation of content from a page inside a folder, that makes a lot of sense. It's a bit tricky with Asset Publisher because it's based on the asset framework which doesn't have a concept of a folder. But it might be easier to do with the new infrastructure to which we could more easily add a folder concept in a generic way. Could you please create a feature request to keep track of the idea?
thumbnail
Christoph Rabel, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
While I am not Krzysztof, we do the same.

We tried it with a customer and it caused us a lot of troubles. We showed the customer a design of a detail page. He was happy and we tried to implement it with mapped content pages. And simply gave up.

You can't map optional fields. If no image is in the content it has to vanish. So, you can't map an image to an image. Simply doesn't work. The same goes for other fields.

So, we tried to create templates for the optional fields and images. We added text fields to the page with an editable as content. That worked to a degree but was somewhat weird.

Then we found that it is tricky to keep things "orderly" when you can move fields around. I mean, when you edit pages, you instantly see the text. You write 100 characters or 500 and adapt things manually so that things fit. But with webcontent as a backend, sometimes stuff is there or not there, sometimes it a text is just a short notice or a couple of thousand characters and so on.

So, we ended up using one big template. We placed a text field on the page and mapped it to the main template.

So, we were basically where we are with Asset publisher and since we have a "working way" here, we simply gave up for now.

--

On top of that came a couple of bugs, which probably are already fixed. In the version we used (I think, it was GA3 or GA4) the navigation vanished on display pages. (I tried it quickly now with GA5, the menu seems to be there)

Anyway: I believe, display pages, especially with the comfortable configuration, are useful. The old way with asset publisher + set as default and so on ... Meh.

But I am highly doubtful about that mapping feature.
thumbnail
Jorge Ferrer, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Legend Posts: 2871 Join Date: 8/31/06 Recent Posts
Hey Christoph, 
Thanks once again for your feedback. Very interesting.
Regarding your first point, we have had some discussions about how to deal with optional fields but haven't focused on it yet. For components with one single editable (Heading, Paragraph, Button, ...) one possible solution would be to provide a configuration to automatically hide the component if the mapping returns an empty value. What do you think? Could you create a feature request for this where we can continue the discussion?
In addition to the above, we believe that we need to add more powerful "preview" capabilities for Display Page Templates while they are being edited. For example, it should be possible to pick any existing content to preview it as you are editing. Maybe even offer the ability to create and edit a content just for the purpose of previewing different options (such as text lengths, optional fields, ...). What are your thoughts on this?
Also, I'm interested in getting a better understanding of what you mean by "we found that it is tricky to keep things "orderly" when you can move fields around". Do you think that the solutions above would be enough to solve this? If not, what else would be needed.
Finally, the solution you have used of a big freemarker template is perfectly valid and the best solution for complex cases. We'll always offer that possibility. At the same time we want to continue investing in alternatives that provide more flexibility for changes by not requiring a developer doing them for as many cases as possible.
thumbnail
Evan Thibodeau, modified 3 Years ago.

RE: Making it easier to add a web content template

New Member Posts: 14 Join Date: 3/29/12 Recent Posts
Hey Jorge, 
Regarding the idea to offer a configuration to automatically hide the component if the mapping returns an empty value... What if we found a way to make it more customizable. Maybe we could allow access to the value returned by the mapping via a freemarker variable so that control is given to the fragment creator to show or hide the component with an if statement. This would also allow for other options such as creating a fragment that will truncate the text that is mapped to it, by modifying the variable before it is printed.I realize this could create some difficulties in managing the fragment while inline editing, but hopefully this could be managed.
thumbnail
Christoph Rabel, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
I have made a feature request for that. We actually do that already with our own fragment renderer. We don't use it for mappings though, currently we use it only for images.
https://issues.liferay.com/browse/LPS-120320
I have described some details, thoughts and doubts, here:
https://liferay.dev/forums/-/message_boards/message/119645413
thumbnail
Jorge Ferrer, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Legend Posts: 2871 Join Date: 8/31/06 Recent Posts
Hey Evan,
Thanks for the suggestion. Adding the editable field values as freemarker variables would be fairly simple. However apart from that you also need to find a way to disable the behavior of automatically inserting that value also inside the lfr-editable element. Any suggestion on how you would suggest doing that?In addition to that, regarding processing/formatting the editable values we have a solution in the works which allows registering formatters for each type of field. One obvious case where this is useful is for dates. The idea is that after selecting the field, the user would also be able to associated a formatter such as the desired date format, a truncation, etc. The backend for this is already mostly in place, but we didn't have time to do the frontend part for 7.3.
thumbnail
Evan Thibodeau, modified 3 Years ago.

RE: Making it easier to add a web content template

New Member Posts: 14 Join Date: 3/29/12 Recent Posts
Hey Jorge, 
The registering formatters idea sounds fantastic. I think this is the best solution for instances like truncation or date formatting. I don't think there is a good way to disable automatically inserting the value in an lfr-editable element without making things unnecessarily complicated. Since the need for this primarily relates to situations where you are mapping values, the inline editing functionality is not especially necessary. If instead we added the ability to not only map to lfr-editable elements but also to configurations, I think we would have most of what we are looking for. If configurations can be mapped, we then already have access to their value as a freemarker variable, thus we can choose to check or modify the value before rendering our fragment. It is not printed by default so we don't need to find a way to disable printing it. 

What do you think? Would that manage most of our requirements?

On a side note: is there any plan to provide a UI for creating fragment configurations?
thumbnail
Christoph Rabel, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
However apart from that you also need to find a way to disable the behavior of automatically inserting that value also inside the lfr-editable element.

I don't understand that one. Can't you just add a flag to the editable?
<lfr-editable freemarkerVar = "myVar" useEditableForFreemarkerMapping="true" ... >...
The developer will know if he wants to keep the editable or if he just wants the variable or if he wants both (there could be usecases for that)
The formatter thing sounds useful too.
thumbnail
Jorge Ferrer, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Legend Posts: 2871 Join Date: 8/31/06 Recent Posts
Hey Christoph, 
Looks like you did understand it based on your answer ;)
I like your suggestion of the freemarkerVar attribute. I think we don't need the second one, since we can imply from the presence of freemarkerVar that the tag contains freemarker that needs to be executed to produce the result. I'll add it to the ticket for future reference.
thumbnail
Christoph Rabel, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
Hi, and I know that it works because I have already implemented it that way. :-)
I wrote a few lines about it a while ago:
https://liferay.dev/forums/-/message_boards/message/119645413
thumbnail
Christoph Rabel, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
Display Page preview: That would certainly be useful. It would at least be nice to immediately see that a field is mapped  instead of the default text.
The tricky part:
The thing is, while the fully flexible layout is awesome in some places, it also creates some issue for the editor. Previously, with the rigid layout some things were easier and some things were outright impossible (well, not true, but required coding/were really tricky).



I have placed three standard cards on a page here and entered some stuff. Editors actually have a hard time with these cards and we have replaced them. While he current version of the card has a TON of options and the number of options is quite overwhelming, this still cannot be fixed by the editor. He can seemingly correctly align things for his resolution but it will break again for other resolutions when the page becomes broader or smaller.

But it is even worse for mappings. When editors map things, they can't see the result and only expect that all elements are correctly aligned. But that isn't true in some cases. This becomes even more true, when you can move them around. When we created the page and mapped stuff, we styled the elements to align correctly. We were asked to place the name of the author on the top left, then some heading and some other stuff.

The customer then asked: I would like the author on the bottom. We said: Oh, just move it down. He did that, but suddenly the margins or something did not add up and we had to fix it. At first, the subtitle had to be in the banner then, they wanted it in the left column, where the editor is.

You soon realize a few things:
The standard elements will get you only so far. You need custom fragments, e.g. for the cards. And a bit later you realize that it is still tricky to make it look good if the elements can be rearranged.

The customer doesn't want to arrange the page. (Ok, there are some guys who really like to fiddle with the page and usually wreak havoc ...) He wants it to look neat and cool and tell somebody "Make it happen".

I had a discussion today with a customer. He wanted to be able to "configure the colors themselves". I said, sure, theme settings and in 7.3 there is a neat new thing called "Style book". Then something weird happened: The person who asked was completely overruled by the rest of marketing: We don't want to do that.
---
thumbnail
Jorge Ferrer, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Legend Posts: 2871 Join Date: 8/31/06 Recent Posts
Thanks for providing so many details about the real world use case. All that information is gold for us!
What you are describing is the reason why we started with the ability to create custom fragments, because there will always be cases where they end up being the most optimal solution. Of course, we also want to make it possible to build sites and pages for as many scenarios as possible. As you've seen in 7.3 we've added much more flexibility in the page editor, but we also want to learn about cases where we might have added to much or at least common use cases that we could provide a simpler solution for. Please, keep the feedback coming emoticon
BTW, I'm particularly interested to find out how the conversation with that custom goes. The scenario that we have had in mind for Style Books is very similar to what you are describing, where for example Marketing defines the desired visual style (or even a full design system) and that's coded in a Style Book (or several variations when desired). The page editors will then be able to choose styling options but only among those defined in the style book. In other words, the style books are not for the person who asked you first, but for their marketing department. Makes sense?
thumbnail
Krzysztof Gołębiowski, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Master Posts: 549 Join Date: 6/25/11 Recent Posts
@Jorge I played around with the Collection Display fragment in GA3 I think, but it was too limited and there were some bugs which prevented us from using it (I'll try to come back to that in GA5 when I have some spare time).

I created the LPS for saving new Web Contents to a folder (https://issues.liferay.com/browse/LPS-120440). I'm aware that folders are not a part of the Asset Framework, but you know how it works in the real life... the customers don't really care about the asset framework, they just come to us and say "why can't we do that in Liferay as we can in [other application]", and in this case, I agree with them. From the business perspective, the lack of ability to save Web Contents to a specific folder straight from Asset Publisher makes the entire concept of Web Content Folders completely useless.

We also decided not to use the fragment Display Pages as they are still too limited for our needs. Apart from no control over optional fields, the articles we have are quite complex and usually contain a lot of additional data like files (attached as AssetLinks) or categories/tags, which have to be displayed in a specific way. Thus, we still need to go with a big Freemarker template rather than mapped fragments.
thumbnail
Christoph Rabel, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
Voted. It would be nice to have some order for webcontents. I suspect, that the amount of webcontent in our projects will decrease (no banners and info cards anymore), but it would still be nice to have an automatic mechanism to put news into the News folder, Events in the events folder, Job offers in the careers folder, ...
thumbnail
Evan Thibodeau, modified 3 Years ago.

RE: Making it easier to add a web content template

New Member Posts: 14 Join Date: 3/29/12 Recent Posts
Hi Krzysztof,
Regarding your comment about the Display pages for fragments: Since you need access to data related to the asset such as categories or tags, I was wondering if you were aware that you can get access to the Asset being displayed on the display page in the freemarker template of a fragment. This means that you can create a fragment that will render categories or tags however you want, when it is placed on a display page. The assetEntry can be accessed as follows:
[#assign currentEntry = (request.getAttribute("LIFERAY_SHARED_LAYOUT_ASSET_ENTRY"))! /]
You may have already been aware of this, and it certainly doesn't solve all the issues you mentioned, but I've found it quite helpful in my own endeavors. emoticon
thumbnail
Jorge Ferrer, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Legend Posts: 2871 Join Date: 8/31/06 Recent Posts
Hey Krzysztof,
Thanks for the information. Using freemarker templates to have full control over how a web content is displayed is perfectly fine. We want to empower non technical users to be able to do more and more on their own, but freemarker templates are there to be used for cases that are more complex than what is supported through the UI. We also want to make make a soft transition between the two so that users don't have to switch to something entirely new when they find out that, for example, mapping of fields is not enough for a certain case. This is the reason why fragment pages (including fragment display pages) also allow:
1) Mapping to templates: With this, it's possible to display the result of rendering the content with a specific freemarker template in an editable field within the fragment 
2) Content Display fragment: this is essentially the same as Web Content Display but a bit easier to use and usable with any type of content.
Have you tried using these features?
thumbnail
Jorge Ferrer, modified 3 Years ago.

RE: Making it easier to add a web content template

Liferay Legend Posts: 2871 Join Date: 8/31/06 Recent Posts
Hey Christoph,
Sorry for the late reply, I took some days off to rest and enjoy family time.
I hear what you are saying. One one side, our goal is to make it so that nobody feels the need to remove the top bar by making it smarter and only contain information and actions relevant to the current user and automatically hide if there is nothing. We have been making steps in this direction in every release.  At the same time I understand that sometimes that's what will be done regardless.
I like your idea of adding a button as a fragment which could not only be useful to solve those scenarios but many others as well. In fact, we have been discussing for a while the idea to support different types of actions within fragments for end users (based on permissions of course) and this would be a good example of that. I'll discuss it with Tarik and will try to propose something for the next release. Feel free to create a feature request for it too to keep track of progress.
Tarik Demnati, modified 3 Years ago.

RE: Making it easier to add a web content template

New Member Posts: 3 Join Date: 2/7/20 Recent Posts
Thanks a lot for the interesting thread plenty of good ideas here. Please do not forget as suggested by Jorge to open FRs we&#39;d be happy to look at them more closely.