Developer forum

Forum » Feature requests » Using DIV with HR templates

Using DIV with HR templates


Reply

Hi,

 

The templates of the HR module are not extended enough for displaying a list of department with the matching employees. There are 3 templates you need to display a proper list, but you cannot wrap parts of this list in a DIV element.

 

At the moment it's just impossible to wrap a DIV element around an employee item, because the employee item always depends on HTML table tags.

 

Kind Regards,

Emil

 

 

 

 

 

 


Replies

 
Reply

Hi Emil,

 

What do you mean that it's impossible to wrap a div aroung an employee? Do you have an example?

 
Reply
Sorensen wrote:

Hi Emil,

 

What do you mean that it's impossible to wrap a div aroung an employee? Do you have an example?


 

Hi Lars,

 

I will illustrate this with an example, currently we've made modifications to the employee templates and it renders the following:

<!-- department name -->
<a href="linktodepartmentpresentation">
 <h3 class="titel3"> Amsterdam Amstel </h3>
</a>
<!-- List of employees within department -->
<div class="med">
 <ul>
  <li style="width: 250px;">
   <a href="linktoemployeepresentation">
   <h3 class="toggler3">Jos van den Berg</h3>
   </a>
  </li>
  <li style="width: 250px;">Service Manager</li>
  <li style="width: 100px;">**********</li>
  <li>**********</li>
 </ul>
</div>
<!-- This will be repeated till the next department -->

 Each employee is wrapped inside a DIV element and this gets repeated for every employee in the department. What we want to achieve is that the list of employees itself is inside a separate DIV element, but this is not possible due to the current template limitations.

 

Code sample of preferred output:


<!-- department name -->
<div class="singledepartment">
 <a href="linktodepartmentpresentation">
  <h3 class="titel3"> Amsterdam Amstel </h3>
 </a>
</div>
<div class="employeelist">
 <ul>
<!-- List of employees within department -->
  <li style="width: 250px;">
   <a href="linktoemployeepresentation">
   <h3 class="toggler3">Jos van den Berg</h3>
   </a>
  </li>
  <li style="width: 250px;">Service Manager</li>
  <li style="width: 100px;">**********</li>
  <li>**********</li>
  <li style="width: 250px;">
   <a href="linktoemployeepresentation">
   <h3 class="toggler3">Jos van den Berg</h3>
   </a>
  </li>
  <li style="width: 250px;">Service Manager</li>
  <li style="width: 100px;">**********</li>
  <li>**********</li>
<!-- This will be repeated till the next department -->
</ul>
</div>

 

Kind Regards,

Emil

 
Reply

It's is still unclear to me why you can't wrap all employees in a single template? Does the module output hard coded HTML that makes it impossible or something?

 
Reply

.

 
Reply

Sorensen wrote:

It's is still unclear to me why you can't wrap all employees in a single template? Does the module output hard coded HTML that makes it impossible or something?

 

Yea i can imagine, it's difficult to explain :-), but i'll try again:

 

It is regarding the Employee Tree functionality. In de List template there currently is an EMTree tag which renders the department and employee list.

 

Inside this EMTree for every department the "DepartmentTemplate.html" template is called and after every department a number of times the "EmployeeTemplate.html" template.

 

So if we look at how DW renders the employee list:

 

1. DW renders "ListTemplate.html"

2. DW renders "DepartmentTemplate.html"

3. DW renders "EmployeeTemplate.html"

4. DW renders "EmployeeTemplate.html"

5. DW renders "EmployeeTemplate.html"

6. DW renders "DepartmentTemplate.html"

7. DW renders "EmployeeTemplate.html"

etc.

 

That's why we are unable to insert a DIV element before it starts rendering the list of employees of a department, because there's no template available to edit that.

 

It would have been cool if the Employee list could be rendered with just a template loop.

 

Is it more clearer now? ;-)

 

Kind Regards,

Emil
 

 
Reply

Ah, now I get it! And you allagation also makes sense now:)

 

Is it the same situation both when you choose "Show employees", "Show departments" and "Show both"?