Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-11686

multi-block attribute for html-template tag

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 22.01.01
    • Trunk
    • framework/widget
    • None

    Description

      Propose a new <script-template> widget tag that adds an external script after body tag.

      The external script will contain the rendered result of the specified template file location.
      e.g.

      <html>
          <script-template location="component://order/template/quote/test.ftl"/> 
      

      <platform-specific>
      will render as:

          </body>
          <script src=“/ordermgr/control/getJs?name=test” type="application/javascript"/></script> 
      </html>
      

      This will allow inline script from a freemarker file, to be rendered as external script in html.

       
      Discussion was started at https://lists.apache.org/thread.html/r7f8db3a8f5de057c5c5ca6c00608e477acfeaf5507a20b72b8daa3a8%40%3Cdev.ofbiz.apache.org%3E

       

      15th May 2020

      While extracting the scripts from html-template to script-template and testing the changes, I found the process to be cumbersome.
      So I made a change not to use script-template tag but add a multi-block attribute to html-template tag.
      When multi-block=true, inline scripts will be extracted automatically from script tag and converted to external script.
      So no need to manually extract script from the existing freemarker template.
      Coding for script-template tag is removed

      Attachments

        1. OFBIZ-11686.patch
          22 kB
          James Yong
        2. OFBIZ-11686.patch
          31 kB
          James Yong
        3. OFBIZ-11686.patch
          28 kB
          James Yong

        Issue Links

          Activity

            People

              jamesyong James Yong
              jamesyong James Yong
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: