Multifield in content fragment model | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

Correct - as discussed in the article - they are created on Author.  A component used in a content fragment can have a dialog - where you can use all grainte data types - including MF.

25 replies

smacdonald2008
New Participant
June 4, 2018

If I had that requirement - i would look at developing an AEM HTL component that can render the data to meet my needs. Something along these lines --

Scott's Digital Community: Creating an AEM HTML Template Language movie component

Notice that we use a dialog to collect data and HTL to display the data, I think following this can address your requirement.

Sean-McK
New Participant
June 4, 2018

Scott,

I understand what you are saying, but when you want a text field in your model you derived from "granite/ui/components/coral/foundation/form/textfield" and when you want a list of things you would normally use "granite/ui/components/coral/foundation/form/multifield". At the base, this is all just "content". Lets say I want my user to have a content fragment with a title and a list of name value pair's. For example we put a movie and location and times the movie is playing. So,

"Deadpool 2"

2:20 - Atlanta

3:00 - New York

How would you suggest on putting that data in a content fragment?

smacdonald2008
New Participant
June 4, 2018

You cannot use a multifield in a fragment. A multifieldis a granite type used on author and typically used in a dialog for a component. A Fragment is a component that renders on Pub. Granite types do not render on Publish.,

Sean-McK
New Participant
June 4, 2018

Shehjad,

I am trying to do the same thing. I tried to add a multifield and it doesn't work. All the simple datatypes work just fine, but creating a multifield doesn't seem to work.

shehjadk2932098
New Participant
April 3, 2018

Hi All,

I have a similar question while creating content fragment model currently we have "single-line-field", "multi-line-field" etc. Is it possible to create another data type similar to multi-field. For example in the fragment model I want to list down N number of links.

Thanks,

Shehjad

smacdonald2008
New Participant
November 10, 2017

Just to summarize what i meant - here is a content fragment example - you can build by following: Adobe Experience Manager Help | Working with Adobe Experience Manager Content Fragments

You can see component on the left (in red) and content fragment on the right.

What i meant was you can use a Multi-field in a component dialog that you drop onto a content fragment. That is the only role i see a Multifield playing while using a Content Fragment.

New Participant
November 10, 2017

Maybe it would be better to give some context to what we are trying to do. At the moment, to create some content, an editor would add a component to a page then populate it with some values via a dialog. The component then renders those variables appropriately.

We may want multiple instances of the same component across our site where the data within those components is the same. At the moment, to do this we would either add the component to each page and configure them individually via a dialog, or we could create one then copy and paste it onto other pages. The problem with these two methods is that if we want to change a value in that repeated component, we need to repeat the work for each instance on each page.

Our intention to improve this process was to separate the dialog and the view in the component from each other. We would create a content fragment as a central source of the data we wanted to display then create a component that we would point to that fragment and render it.

When creating the content fragment, we want the editors to enter data in a structured format (as they would in a dialog) and we identified content fragment models as a way to do that. It's in these models that I was hoping I could add a multifield; as it stands, these are the only field types available:

smacdonald2008
New Participant
November 10, 2017

Are you referring to overriding the Content Fragment wizard and injecting a Multifield here:

smacdonald2008
New Participant
November 10, 2017

If you look at this illustration--

A component can be part of a Content Fragment. That component can have a dialog which is used to populate that component with data.

Therefore a Multifield can be part of the component dialog - which renders content that is displays within the Content Fragment. However - a MF cannot be used within the Fragment itself.

I hope this clear its up.

New Participant
November 10, 2017

If that's the case then, I thought a content fragment model is essentially just a dialog for creating the content fragment (in the author).