问题
I need to enable source button on my richText control ( I have to put there HTML code ) and I have follow this tutorial: https://documentation.magnolia-cms.com/display/DOCS/Rich+text
So I have added following settings source - true - Boolean in standard-templating-kit/dialogs/generic/controls/text but it doesn't work for me.
I'm using Magnolia CMS 5.2.4. Can anybody please tell me how I can turn on this button or maybe if there is another control to put there html code ?
Best Regards Jan
回答1:
Have you defined your dialogs using Blossom? If so, they are completely distinct from the STK dialogs. If you have something like the following example, you will need to change your code to set up the rich text area with a source button.
@TabFactory("heading")
public void headingTab(UiConfig cfg, TabBuilder tab) {
FieldConfig fields = cfg.fields;
tab.fields(
fields.text("headingtitle").i18n().required(),
fields.richText("headingtext").i18n().required()
);
}
The above example would be modified by defining the rich text field and then modifying the definition.
@TabFactory("heading")
public void headingTab(UiConfig cfg, TabBuilder tab) {
FieldConfig fields = cfg.fields;
RichTextFieldBuilder richText = fields.richText("headingtext").i18n().required();
richText.definition().setSource(true);
tab.fields(
fields.text("headingtitle").i18n().required(),
richText
);
}
来源:https://stackoverflow.com/questions/31224875/add-source-button-to-magnolia-cms-richtext-control