Templates Resources

Majority of Numsolar information is available in the templates.

What is a resource?

Resource is an object or a collection of objects that are available in the Template. Following resources are available:

How to access the resource from your template?

You specify a resources access URL that indicates which data to dynamically insert into the template.
  • To access value you reference resources name and than attribute name
  • If the attribute is a collection, you can indicate which element of the collection to take like collection.0.name
  • The same resource access URL is used with the 'IF' attributes
                      
                      <numsolar field="prospect.first-name"></numsolar> 
                      
                      <numsolar field="monthly_simulation.chh.0"></numsolar>
                      
                    

How can I use resources with 'IF' attribute?

You can compare resources with the comparison operators: =, !=, >, <
  • You can have if attribute without a comparison operator to check if the resource is present
  • With 2 resources you can compare them between each other
                      
                      <numsolar if="prospect.first-name"></numsolar> 
                      
                      <numsolar if="monthly_simulation.chh.0>monthly_simulation.chh.1"></numsolar>
                      
                    
Organisation
                      
                      
                      
                      <h1 class="text-3xl">
                      
                          <numsolar field="organisation.title"></numsolar>
                      
                      </h1>
                      
                      <numsolar class="border rounded-lg w-32 h-32" img="organisation.logo_s3_path"></numsolar>
                      
                    
Manager
                      
                      
                      
                      <span class="text-lg">
                      
                          <numsolar field="manager.first_name" if="manager.first_name"></numsolar>
                      
                          <numsolar field="manager.last_name" if="manager.last_name"></numsolar>
                      
                      </span>
                      
                    
Prospect
                      
                      
                      
                      <span class="text-lg">
                      
                          <numsolar field="prospect.first_name" if="prospect.first_name"></numsolar>
                      
                          <numsolar field="prospect.last_name" if="prospect.last_name"></numsolar>
                      
                      </span>
                      
                    
Packages
  • Package that was used to create an offer for the client.
                      
                      
                      
                      <h2 class="text-2xl"><numsolar field="package.title" if="package.title"></numsolar></h2>
                      
                      <p if="package.description">
                      
                          <numsolar field="package.description"></numsolar>
                      
                      </p>
                      
                    
Offer
  • Package that was used to create an offer for the client.
                      
                      
                      
                      <h2 class="text-2xl"><numsolar field="offer.title" if="offer.title"></numsolar></h2>
                      
                      <table>
                      
                      <tr>
                      
                          <th>Line</th>
                      
                          <th>Cost</th>
                      
                      </tr>
                      
                      <numsolar each="offer.configuration_lines">
                      
                          <tr>
                      
                              <td><numsolar field="item.title"></numsolar></td> 
                      
                              <td><numsolar field="item.visible_cost" format="money"></numsolar></td>
                      
                          </tr>
                      
                      </numsolar>
                      
                      </table>
                      
                      <h3 class="text-3xl"><numsolar field="offer.subtotals.grand_total" if="offer.subtotals.grand_total" format="money"></numsolar></h3>
                      
                      
                      
                    
Simulation
  • Manager associated to the prospect
                      
                      
                      
                      <span class="text-lg">
                      
                          <numsolar field="mothly_simulation.chh.0" if="monthly_simulation.chh.0"></numsolar>
                      
                          <numsolar field="yearly_simulation.chh.0" if="yearly_simulation.chh.0"></numsolar>
                      
                      </span>
                      
                    
Attachments
  • Attachments that are associated to the package or the house
                      
                      
                      
                      <span class="text-lg">
                      
                          <numsolar img="attachments.package.0" if="attachments.package.0"></numsolar>
                      
                          <numsolar img="attachments.house.0" if="attachments.house.0"></numsolar>
                      
                      </span>
                      
                    
Summary
  • Summary of installation, offer and the simulation
                      
                      
                      
                      <span class="text-lg">
                      
                          <numsolar field="summary.battery_title" if="summary.batteries_count>0"></numsolar>
                      
                      </span>