Archive
Posts Tagged ‘Web Templates’
Dynamics Portals – SaaS – Refer helper files in Web Templates
January 9, 2018
Leave a comment
In my portal, I got a requirement to build a ‘Search Screen’, which pulls the data from CRM and render the results.
To achieve this, I configured a ‘Web Template’ with ‘Search Screen’ using HTML and decided to use Data Tables table control to bind the results.
The challenge is, to use ‘Data Table’ control, I must refer the helper files (i.e., datatable.min.js, jquery.datatable.css) in my ‘Search Screen’ Web Template.
One way to solve is to copy the content from the helper files (i.e., datatable.min.js, jquery.datatable.css) and paste within the Web Template. This is a crude way as the single Web Template size enormously grows and would become unmanageable.
Optimal way:
- Create a separate Web Templates for Helper files (i.e., datatable.min.js, jquery.datatable.css)
- Make sure you wrap the script file’s content in <script> tag, while pasting to Web Template.
- Make sure you wrap the style sheet (i.e., css) files content in <style> tag, while pasting to Web Template.
- Refer the helper file Web Templates in the ‘Search Screen’ Web Template.
- Syntax is {% include ‘Your helper file Web Template Name‘ %}
Notes:
- Using Web Files is one approach but you cannot attach JScript file to your Web File as the .js file extension is restricted.
🙂
Categories: Dynamics Portals
ADX, Dynamics 365, Portal, Web Templates