我使用木兰5.5.5与一个自定义的故事应用程序,我希望有可能在一个区块的文本和图像。这样我就可以写一个文本,然后决定图像是否在下面/上面/左/右,文本是否会围绕它浮动。
以下各项经过测试,将不起作用:
class: info.magnolia.editor.block.stock.FieldSetBlockDefinition templateId: stories-app:blocks/textImage icon: text-block label: textImage fields: text: blockClass: info.magnolia.editor.block.stock.RichTextBlock image: class: info.magnolia.editor.app.field.ExpandingLinkFieldDefinition buttonSelectNewLabel: browse buttonSelectOtherLabel: browse ....
像这样的东西太棒了。否则我将不得不在 for block in blocks 使用css循环和。虽然我认为这是可行的,但你认为嵌套块怎么样?你将如何解决这个问题?
for block in blocks
我认为你绕错了方向。内容编辑器与表示无关,您希望打破它。 相反,您应该只在模板呈现文章时解决这个问题,在模板呈现文章时,您会发现文本块和图像块,并定位图像,让文本相应地围绕它流动。