Hi all,
It might be of interest to some users of Reeposition plugin my experience in using this plugin together with Find and Replace plugin and solving parsing order problem.
My initial code was as follows:
{exp:reeposition}
{reeposition:put_item id="first_item"}
{reeposition:put_item id="second_item"}
{reeposition:item id="first_item"}
<ul> First list:
{exp:weblog:entries weblog="commentary" limit="5" sort="asc" sort_by="title"}
<li>{title}</li>
{/exp:weblog:entries}
</ul>
{/reeposition:item}
{reeposition:item id="second_item"}
<ul> Second List:
{exp:weblog:entries weblog="dictionary" limit="5" sort="asc" sort_by="title"}
<li>{title}</li>
{/exp:weblog:entries}
</ul>
{/reeposition:item}
<textarea cols="60" rows="10">
{exp:replace find="<|>" replace="<|>" multiple="yes"}
{reeposition:put_item id="first_item"}
{reeposition:put_item id="second_item"}
{/exp:replace}
</textarea>
{/exp:reeposition}
This code did not work: Reeposition plugin moved items, but Find and Replace plugin replaced nothing since {exp:replace} tag was parsed before {exp:reeposition} tag.
Trying to add parse=“inward” parameter to {exp:reeposition} tag did not help: {exp:weblog:entries} remained unparsed.
In this situation needed parsing order is this:
1) {exp:weblog:entries} tag
2) {exp:reeposition} tag
3) {exp:replace_plus} tag
But to achieve such parsing order was not possible because we cannot wrap {exp:reeposition} tag with {exp:replace_plus} tag - if we did the Find and Replace plugin replaced characters inside and outside of <textarea> element.
Solution I adopted is this: I tweaked Find and Replace plugin by introducing {replace_area_start}{replace_area_end} variable pair. This variable pair allows us to delimit area in which we want replace operation to be done and by delimiting such area it allows us to wrap with Find and Replace plugin tag some other tag or tags.
You can find tweaked version of Find and Replace plugin (called “Find and Replace Plus”)
here.
Using {replace_area_start}{replace_area_end} variable pair of Find and Replace Plus plugin the needed parsing order can be achieved writing the code as this:
{exp:replace_plus find="<|>" replace="<|>" multiple="yes"}
{exp:reeposition}
{reeposition:put_item id="first_item"}
{reeposition:put_item id="second_item"}
{reeposition:item id="first_item"}
<ul> First list:
{exp:weblog:entries weblog="commentary" limit="5" sort="asc" sort_by="title"}
<li>{title}</li>
{/exp:weblog:entries}
</ul>
{/reeposition:item}
{reeposition:item id="second_item"}
<ul> Second List:
{exp:weblog:entries weblog="dictionary" limit="5" sort="asc" sort_by="title"}
<li>{title}</li>
{/exp:weblog:entries}
</ul>
{/reeposition:item}
<textarea cols="60" rows="10">
{replace_area_start}
{reeposition:put_item id="first_item"}
{reeposition:put_item id="second_item"}
{replace_area_end}
</textarea>
{/exp:reeposition}
{/exp:replace_plus}
Thank you, Mr. Wilson, very very much for amazing Reeposition plugin. I cannot imagine ExpressionEngine development without it anymore!