IC SunsetThe developerWorks Connections platform will be sunset on December 31, 2019. On January 1, 2020, this forum will no longer be available. More details available on our FAQ.
Topic
  • 2 replies
  • Latest Post - ‏2019-09-19T16:09:30Z by Manab Das
Manab Das
Manab Das
2 Posts

Pinned topic refer image or css file from within custom html in BPM Coach

‏2019-09-17T13:55:44Z |

Hi All,

I am using IBM BPM 8.5.7. I have a heritage coach within a Human Heritage Service. 

Actually I need to render an html page from this service. Client has provided the HTML page along with css files, image files and fonts etc. We have to use this html file.

I have added a 'custom html' in the Coach and bounded it with a string variable and paste the entire html file in the String variable that I bound with the custom html.

Now, there are multiple CSS files and image files which have been referred in the html file as shown below.

<link href="core/css/bootstrap.min.css" rel="stylesheet" />

Could any one please tell me how to link these external files (css, images) from the html ? For the css files I have an alternate way to copy all the content of the css and paste within the <style></style> tag in the html. But I did not find a way to refer the icon files. If I upload all the css and image/icons and other related files like .svg, .ttf,  .eof, .woff  in the process under 'Files' section, still I am not able to access those files. May be I am missing the correct way to show the path. That is why the images or icons are not getting rendered in the html.

I am attaching few screen shots in the word doc to depict the way I have done it.

Please some one advise how to refer/link the files.

  • Atanu
    Atanu
    209 Posts
    ACCEPTED ANSWER

    Re: refer image or css file from within custom html in BPM Coach

    ‏2019-09-19T03:50:02Z  

    You need to specify the path of the files using below JS API within the scritlet. Like - 

    <link href='<#= tw.system.model.findManagedFileByPath("bootstrap.min.css", TWManagedFile.Types.Web).url #>' rel="stylesheet" />
    

     

    - Atanu Roy

  • Atanu
    Atanu
    209 Posts

    Re: refer image or css file from within custom html in BPM Coach

    ‏2019-09-19T03:50:02Z  

    You need to specify the path of the files using below JS API within the scritlet. Like - 

    <link href='<#= tw.system.model.findManagedFileByPath("bootstrap.min.css", TWManagedFile.Types.Web).url #>' rel="stylesheet" />
    

     

    - Atanu Roy

  • Manab Das
    Manab Das
    2 Posts

    Re: refer image or css file from within custom html in BPM Coach

    ‏2019-09-19T16:09:30Z  
    • Atanu
    • ‏2019-09-19T03:50:02Z

    You need to specify the path of the files using below JS API within the scritlet. Like - 

    <pre class="html dw" dir="ltr"><link href='<#= tw.system.model.findManagedFileByPath("bootstrap.min.css", TWManagedFile.Types.Web).url #>' rel="stylesheet" /> </pre>

     

    - Atanu Roy

    Hi Atanu,

    Thanks a ton !!!!  It really helped.

    Thank you very much.