Hi Amit,

there seems to be a misunderstanding: ftl files are Freemarker template files (hence the extension). They can contain any text and also html or any other format along with the Freemarker language to deal with dynamic data to be rendered. Using the Freemarker language is optional.

If you want to render a plain html file, you can just fill your template with the html. The output of the ftl file rendered by OFBiz is send to the client's browser and diplayed there.

There is no need for an extra extension handled in the HtmlWidget.

Regards,

Michael


Am 11.12.17 um 17:00 schrieb Amit Gadaley:
Hello Everyone,

OFBiz only supports the rendering of *.ftl files in OFBiz screens.
*.ftl files are same as *.html files with richer capabilities but sometimes
there are situations where a user needs to render only *.html files instead
of *.ftl files.

I have debugged the code and figure out that method '*renderHtmlTemplate*'
of HtmlWidget.java is responsible for rendering *.ftl files. I walked
through it and met with this condition:

if (location.endsWith(".ftl")) {
      // render file
} else {
     //return error
}

My proposal is to update this condition like this:

if (location.endsWith(".ftl") || location.endsWith(".html")) {
      // render file
} else {
     //return error
}

I have tested it and it is working fine. I don't see any harm in this
change.

Please share your inputs on this.


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to