Advertisements
Home > Dynamics Portals > Dynamics Portals – SaaS – Refer helper files in Web Templates

Dynamics Portals – SaaS – Refer helper files in Web Templates

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.

WT - JS

  • Make sure you wrap the style sheet (i.e., css) files content in <style> tag, while pasting to Web Template.

WT - CSS

  • Refer the helper file Web Templates in the ‘Search Screen’ Web Template.
    • Syntax is {% include ‘Your helper file Web Template Name‘ %} 

Refer files 3

Notes:

  • Using Web  Files is one approach but you cannot attach JScript file to your Web File as the .js file extension is restricted.

🙂

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: