With the overall goal of reducing page load time (Memory, Execution Time in template debugging), how can I rework my Playa templates so as to “shut off” the Playa Extension?
Template debugging shows that I have 511 lines like so:
Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(The largest batch of them, 435 at a stretch, adds 3 seconds and 5MB to page execution time. And of course those 511 lines of calls appear on a section of the site that isn't using Playa. I've already gotten rid of similar calls for Matrix and P&T Field Packs by downloading the latest Field Pack off Github)
In this (old) P&T Support discussion thread, Brandon Kelly mentions that it's possible, by adding A Thing Or Two to your Playa tags, to disable the Playa extension. (I've done that with Matrix and, Field Pack, thanks to the latest version of them)
Brandon:
You’d just have to remember to set entry_id="{entry_id}" on any Playa tags inside {exp:channel:entries}, as well as set the var_prefix= param:
{exp:playa:children field="some_field" entry_id="{entry_id}" var_prefix="child"}
{child:title}
...
{/exp:playa:children}
How do I apply that in this situation where I have a matrix tag pair and all that image replacement stuff going on?
{exp:channel:entries
channel="thankyou"
orderby="date"
sort="desc"
limit="1"
}
<h2>Thank you {title}</h2>
{thanks_body}
{!-- Playa Field tag pair: --}
{thanks_related_entries limit="8"}
<div class="related blurb">
{exp:lg_replace:haystack needles="{mtrx_images backspace="1"}image_{row_count}|{/mtrx_images}"}
<h4>
{if channel_id=="1"}<a href="/news/view/{url_title}">{/if}
{if channel_id=="4"}<a href="/articles/view/{url_title}">{/if}
{title}</a> </h4>
<p class="excerpt">
{exp:eehive_hacksaw words="55" append="…"}
{exp:smartdown} {summary} {body} {/exp:smartdown}
{/exp:eehive_hacksaw}
{mtrx_images}
{exp:lg_replace:replacement needle="image_{row_count}"}
<a href="{img}" title="{img-caption}">{exp:ce_img:single src="{img}" width="70" alt="{img-caption}" class="left" title="{img-caption}"}</a>
{/exp:lg_replace:replacement}
{/mtrx_images}
</p>
<p class="excerpt smallcaps">{if channel_id=="1"}<a href="/news/view/{url_title}">{/if}{if channel_id=="4"}<a href="/articles/view/{url_title}">{/if}» Read This</a></p>
{/exp:lg_replace:haystack}
</div>
{/thanks_related_entries}
Used in a similar manner in another location, I've wrapped the entire playa tags inside an if statement:
{if static_playa_related_posts}
{static_playa_related_posts limit="15"}
...STUFF....
{/static_playa_related_posts}
{/if}