Foros de discusión

Editor templates for structured web content

Nick Straguzzi, modificado hace 12 años.

Editor templates for structured web content

New Member Mensajes: 20 Fecha de incorporación: 29/04/11 Mensajes recientes
Hi, long-time listener, first-time caller. I would like to be able to create custom WCMS editor forms for individual content structures.

For example, I often create custom content classes for lists of hyperlinks. With minor variations, each subrecord would consist of a URL, an HTML string for the link text, and an display option or two. I can create very nice display templates for this content. However, the Liferay auto-generated structured editor is very unwieldy for long lists -- it's pages upon pages of CKEdtiors and text fields stacked one on top of the other. (Plus, there is no way to reorder the items in the list, which is an essential feature that I know has been suggested before.)

My suggestion is to allow every CMS structure to supply an editor template in addition to display template. In the editor template, I can define how each subrecord should be laid out, including what form controls and labels to use for each field and how to arrange them. (In my case, I would likely use something akin to a grid layout, where each link record has its controls laid out horizontally rather than vertically, and with a far, far smaller set of toolbar controls for the CKEditor instance.)

QUESTION: Is there a way to accomplish this in Liferay currently without writing a Hook or Ext plugin? If not, could this be a feature for a future release?
thumbnail
Jorge Ferrer, modificado hace 12 años.

RE: Editor templates for structured web content

Liferay Legend Mensajes: 2871 Fecha de incorporación: 31/08/06 Mensajes recientes
Hey Nick,

Have you tried making the field (or set of fields) repeatable?

That allows the author to enter as many of them as needed for each specific content with that structure.
Nick Straguzzi, modificado hace 12 años.

RE: Editor templates for structured web content

New Member Mensajes: 20 Fecha de incorporación: 29/04/11 Mensajes recientes
Jorge - thanks for the reply.

Yes, I already have a structure set up using repeatable fields, and they work great. The problem is that the editor form becomes way too unwieldy to use if there are a lot of links in the structure (plus, there's no way to reorder the items.)

For example, say my customer wants to create a list of 25 "useful links" on his website. In the editor, every substructure requires (1) an HTML field for the link text, (2) a text field for the URL itself, and (3) one or two additional fields for display options (alt text, title, soft-delete field, etc.) The CMS "editor generator" produces a page consisting of each field stacked vertically; it actually takes up nearly the entire visible height of the browser. Multiply that by 25 items, and throw in the fact that there is no way to reorder the list items, and you can see how this quickly becomes impractical.

What I would prefer is to be able to define a template that looks something like this for each "row" in the list (forgive the ASCII graphics):

hyperlink text:               URL:                    title:
 ----------------------    ----------------------     --------------------
| CKEditor             |  |                      |   |                    |   (up arrow) (down arrow) (trashcan)
 ----------------------    ----------------------     --------------------


...Now, each substructure is represented horizontally rather than vertically, and I can reorder or delete an item by using the icons at the right. I understand this isn't possible using Liferay today. Questions: (a) do you feel that the ability to customize editor pages [or at least make them a bit more amenable to use when repeated substructures are involved] is a worthwhile addition to LR? And, (b) is there a way in the meantime that I can create a Hook or Ext plugin to customize the editor page for this structure, and if so, how would I go about doing it?

Thanks,
Nick
thumbnail
Sébastien Nadeau, modificado hace 11 años.

RE: Editor templates for structured web content

New Member Mensajes: 18 Fecha de incorporación: 6/03/12 Mensajes recientes
Ho my god, I finally found my way to this message!

I have the exact same need: to be able to easily reorder fields for arepeatable structure. And my structure is almost the same thing as Nick: a list of useful links.

Our webmaster is actually struggling with lists that contains many links, he'd like to be able to using up and down arrows instead of deleting an entry and reposition it somewhere else in the list.

Actually, the web content edition interface offers only the Add and Delete buttons. We would appreciate a lot to have Up and Down Arrows to be able to switch a repeatable field with the previous or the next one.

I tried to make this improvement by myself using a Hook on html/portlet/journal/edit_article_content_xsd_el.jsp, but the Javascript file html/portlet/journal/js/main.js is also involved in the edition process and that makes it an incredible challenge since this Javascript is very complicated.

Hope you guys can help me, it would help keep my Webmaster sanity to a reasonable level!

Thank you!
Vanessa Busch, modificado hace 9 años.

RE: Editor templates for structured web content

New Member Mensajes: 4 Fecha de incorporación: 11/07/11 Mensajes recientes
Just like Nick and Sebastien, we would also would like to be able to reorder repeatable content.

Does anyone have a suggestion on the best way of achieving this. Has anyone looked into the sources to see what would be involved? Or are we better to create a custom portlet to meet our needs?

Here is a photo of what we would like to achieve.

Archivos adjuntos: