Note that there are some explanatory texts on larger screens.

plurals
  1. POExpressionEngine templates: pass a plugin/module's output as parameter to another plugin/module
    primarykey
    data
    text
    <p>Here's basically what I want to accomplish:</p> <pre><code>{exp:plugin1:method arg="{exp:plugin2:method}"} </code></pre> <p>I’ve tried a number of different approaches.</p> <h2>Approach 1:</h2> <pre><code>{exp:plugin1:method arg="{exp:plugin2:method}"} </code></pre> <p><strong>Result:</strong> <code>Plugin1-&gt;method</code>’s <code>arg</code> parameter value is the string, <code>{exp:plugin2:method}</code>, and it’s never parsed.</p> <h2>Approach 2:</h2> <p>My understanding of the parsing order suggests that this might have different results, but apparently it does not.</p> <pre><code>{preload_replace:replaced="{exp:plugin2:method}"} {exp:plugin1:method arg="{replaced}"} </code></pre> <p><strong>Result:</strong> The <code>arg</code> parameter has the same value as approach 1.</p> <h2>Approach 3:</h2> <p>First I define a snippet (<code>snip</code>), whose content is:</p> <pre><code>{exp:plugin2:method} </code></pre> <p>Then in the template:</p> <pre><code>{exp:plugin1:method arg="{snip}"} </code></pre> <p><strong>Result:</strong> Same as approaches 1 and 2.</p> <h2>Approach 4:</h2> <p>Noting that plugins are processed in the order they appear, I have even tested simply placing an instance of <code>{exp:plugin2:method}</code> before the <code>{exp:plugin1:method}</code> call. My thinking is that I could wrap this first call in a regex replacement plugin in order to suppress output, but that it would trigger Plugin2’s parsing first.</p> <pre><code>{exp:plugin2:method} {exp:plugin1:method arg="{exp:plugin2:method}"} </code></pre> <p><strong>Result:</strong> <code>Plugin1-&gt;method</code>’s <code>arg</code> parameter value is the temporary hash placeholder for <code>Plugin2-&gt;method</code>’s output (MD5 I believe) that the Template class reserves until later.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload