Tagger icon indicating copy to clipboard operation
Tagger copied to clipboard

Very long page load when multiple TaggerGetTags calls are on 1 page

Open pmacswebteam opened this issue 8 years ago • 0 comments

We have a list of roughly 200 resources in a MODX collection. We are using getResources to display the sortable list of resources. The list is sortable based on 2 different tag groups. A sample of our code in the template chunk is below. As you will see, we need 3 TaggerGetTags calls in order for this to function properly, however, with this many snippet calls, we've noticed a significant increase in the page load time (about 1min). Is there a better way to optimize this?

<div class="grid mix[[TaggerGetTags? &resources=`[[+id]]` &rowTpl=`tag-class-tpl`]]">
  <!-- NAME -->
  <div class="unit three-quarters">
    <div class="unit one-quarter no-gutters">
  	[[+tv.url:ne=``:then=`<a href="[[+tv.url]]" target="_blank">[[+pagetitle]]</a>`:else=`[[+pagetitle]]`]]
	<br>
	<span class="fac-title">[[+longtitle]]</span>
    </div>
    <!-- DIVISION -->
    <div class="unit one-quarter no-gutters fac-divisions">[[TaggerGetTags? &groups=`2` &resources=`[[+id]]` &rowTpl=`tag-label-tpl` &separator=`, ` ]]</div>
    <!-- SPECIALTY -->
    <div class="unit half no-gutters fac-specialty">[[+tv.specialty:default=`N/A`]]</div>
  </div>
  <div class="unit one-quarter">
    <!-- LOCATION -->
    <div class="unit three-fifths no-gutters fac-location">[[TaggerGetTags:default=`N/A`? &groups=`1` &resources=`[[+id]]` &rowTpl=`tag-label-tpl` &separator=`, `]]</div>
    <!-- RESEARCH -->
    <div class="unit two-fifths fac-research">[[+tv.research:default=`N/A`]]</div>
  </div>
</div>

pmacswebteam avatar May 08 '17 15:05 pmacswebteam