How Can we embed external HTML files in Nuxeo Platform
Hi All, I want to embed some custom HTML file in my content view. How can we achieve the same ?
Can anyone tell me how can I embed a custom HTML template in my Nuxeo content View. Basically, I want to load an HTML file using IFrame in Nuxeo. Is this possible ?
I have tried following things so far,
- Using the following link tried to understand how to create a custom layout and widget but the document just explains on how to create custom layout and widget and not how to confgiure them.
- Seeing some of the existing examples on Nuxeo forum I see that we can use extension points but again this is very high level and doesn't have thorough explaination on how you configure the templates defined in extension points. I tried creating my custom extension as below
<extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager" point="layouts"> <layout name="req_custom_template"> <aliases> <alias>Custom Template</alias> </aliases> <columns> <column name="last_contributor"> <widget>req_custom_widget</widget> </column> </columns> </layout> </extension> <extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager" point="widgets"> <widget name="req_custom_widget" type="template"> <labels> <label mode="any"></label> </labels> <translated>false</translated> <fields> <field>data</field> </fields> <properties widgetMode="any"> <property name="template">/layouts/external_html.xhtml</property> </properties> </widget> </extension>
and provided my custom template in
NUXEO_HOME/templates/custom/layouts directory and published my content. And In studio, when I see the
External Layouts dropdown for Document, I see as below,
However, I found that in the document creation layout there is an existing widget called
templateand tried using my XHTML file there and use it. Upon publishing, I see my custom HTML content (which is great).
Still I would like to know what is the correct way of doing this.