Please note that I have moved the plugin’s download location and created some very basic documentation. I will be improving the documentation for all of my EE projects over the coming months.
Hi Mr.Wilson,
Thanks for excellent plugin. In many situations it proved to be very useful.
Here is one problem I stumbled upon using Reeposition plugin: it seems that items wchich were moved by Reeposition plugin are not available as data for other plugins.
For example, consider this code in which Reeposion plugin is used together with Find and Replace plugin:
{exp:reeposition}
{exp:weblog:entries weblog="my_weblog" limit="1" sort="asc"}
{reeposition:put_item id="first_item"}
{reeposition:put_item id="second_item"}
{reeposition:item id="first_item"}
Some code
{/reeposition:item}
{reeposition:item id="second_item"}
Some code
{/reeposition:item}
<textarea>
{exp:replace find="<|>" replace="& lt;|& gt;" multiple="yes"}
{reeposition:put_item id="first_item"}
{reeposition:put_item id="second_item"}
{/exp:replace}
</textarea>
{/exp:weblog:entries}
{/exp:reeposition}
Items get moved, but the plugin Find and replace does not replace anything.
Is it possible to achieve that items moved were used as data for some other plugin? If not, what kind of changes in Reeposition or/and Find and Replace plugins might be necessary to achieve it?
Hi Mr Wilson,
I’ve been using your plugin for only a few weeks and it works great. However I appear to be having problems with conditionals. I noticed that there can be problems with advanced conditionals, but I am only using basic ones.
I’ve simplified my template to demonstrate. Note: the weblog entry fetched for public_content contains has an empty pg_heading field
{exp:reeposition}
{!-- Fetch Input --}
{exp:weblog:entries weblog="public_content" url_title="our_people"}
{if pg_heading != ""}
got heading
{reeposition:item id="pg_heading"}<h2>got heading: '{pg_heading}'</h2>{/reeposition:item}
{/if}
{if pg_heading == ""}
no heading
{reeposition:item id="pg_heading"}<h2>no heading: '{pg_heading}'</h2>{/reeposition:item}
{/if}
{/exp:weblog:entries}
{!-- Output --}
{reeposition:put_item id="pg_heading"}
{/exp:reeposition}
Now, I would expect the above code to output “no heading” (from the exp:weblog:entries loop) and for the reeposition put_item call to output:
<h2>no heading: ''</h2>
When I run this code however, I get “no heading” (as expected) but reeposition outputs:
<h2>got heading: ''</h2>
One strange thing, is that if I swap the position of the if statements (so that pg_heading != “” is tested after pg_heading == “”) then reeposition outputs the correct statement.
It appears to me as if the {reeposition:item id="pg_heading"} calls are processed regardless of the surrounding if statements?
Of course its pointless having those two if statements, but the problem I was having initially was that reeposition would always output a heading even when the heading was an empty string.
How about this? (untested)
{exp:reeposition}
{!-- Fetch Input --}
{exp:weblog:entries weblog="public_content" url_title="our_people"}
{reeposition:item id="pg_heading"}
{if pg_heading != ""}
got heading
<h2>got heading: '{pg_heading}'</h2>
{/if}
{if pg_heading == ""}
no heading
<h2>no heading: '{pg_heading}'</h2>
{/if}
{/reeposition:item}
{/exp:weblog:entries}
{!-- Output --}
{reeposition:put_item id="pg_heading"}
{/exp:reeposition}
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!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.